ช่วยทีครับเกี่ยวกับ .aspx IIS 7 Windows server 2008R2
คือผมเข้าเว็บ .aspx มันขึ้นแบบนี้ครับ
Code
Server Error in '/' Application.
Parser Error
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.
Parser Error Message: Could not load the assembly 'App_Web_qud97qiz'. Make sure that it is compiled before accessing the page.
Source Error:
Line 1: <%@ page language="C#" autoeventwireup="true" inherits="api_Login, App_Web_qud97qiz" %>
Source File: /warz/api/api_login.aspx Line: 1
ไฟล์ aspx ผม pusblish จาก VS2008 มา
Code (VB.NET)
using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Data;
using System.Text;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Configuration;
public partial class api_Login : WOApiWebPage
{
protected override void Execute()
{
string username = web.Param("username");
string password = web.Param("password");
SqlCommand sqcmd = new SqlCommand();
sqcmd.CommandType = CommandType.StoredProcedure;
sqcmd.CommandText = "WZ_ACCOUNT_LOGIN";
sqcmd.Parameters.AddWithValue("@in_IP", LastIP);
sqcmd.Parameters.AddWithValue("@in_Username", username);
sqcmd.Parameters.AddWithValue("@in_Password", password);
if (!CallWOApi(sqcmd))
return;
reader.Read();
int CustomerID = getInt("CustomerID"); ;
int AccountStatus = getInt("AccountStatus");
int SessionID = 0;
int IsDeveloper = 0;
if (CustomerID > 0)
{
SessionID = getInt("SessionID");
IsDeveloper = getInt("IsDeveloper");
}
GResponse.Write("WO_0");
GResponse.Write(string.Format("{0} {1} {2}",
CustomerID, SessionID, AccountStatus));
}
}
อันนี้ตัว web.config Code (C#)
<?xml version="1.0"?>
<!--
Note: As an alternative to hand editing this file you can use the
web admin tool to configure settings for your application. Use
the Website->Asp.Net Configuration option in Visual Studio.
A full list of settings and comments can be found in
machine.config.comments usually located in
\Windows\Microsoft.Net\Framework\v2.x\Config
-->
<configuration>
<!-- application specific settings -->
<appSettings>
<add key="WO_Region" value="EN"/>
</appSettings>
<connectionStrings>
<add name="dbConnectionString" connectionString="Server=localhost,1433;Database=WarZ;User ID=wz_api_user;Password=g54vxca5Ez;Trusted_Connection=False;" providerName="System.Data.SqlClient"/>
</connectionStrings>
<system.web>
<httpRuntime enableVersionHeader="false"/>
<!--
Set compilation debug="true" to insert debugging
symbols into the compiled page. Because this
affects performance, set this value to true only
during development.
-->
<compilation debug="true">
<assemblies>
<add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/></assemblies></compilation>
<!--
The <authentication> section enables configuration
of the security authentication mode used by
ASP.NET to identify an incoming user.
-->
<!--<authentication mode="None"/>-->
<!--
The <customErrors> section enables configuration
of what to do if/when an unhandled error occurs
during the execution of a request. Specifically,
it enables developers to configure html error pages
to be displayed in place of a error stack trace.
<customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
<error statusCode="403" redirect="NoAccess.htm" />
<error statusCode="404" redirect="FileNotFound.htm" />
</customErrors>
-->
</system.web>
</configuration>