The Account Logon interface file is login. aspx. The background code is login. aspx. CS in.. NET 2005 passes the test. After it can be published and runs in IIS, the following error message is displayed.
========================================================== ========================================================
Description:An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler error message:Cs0030: cannot convert type 'asp. login_aspx 'to 'System. Web. UI. webcontrols. login'
Source file:C: \ winnt \ Microsoft. NET \ framework \ v2.0.50727 \ temporary ASP. Net files \ Root \ 21f002dd \ 13ab9d48 \ app_web_login.aspx.cdcab7d2.vqjr2cxo.0.csLine:116
Compiler warning messages:
Server Error in '/'application. Compilation Error
Warning:Cs0108: 'asp. login_aspx.profile 'hides inherited member 'login. profile'. Use the New Keyword if hiding was intended.
Source error:
Warning:Cs0108: 'asp. login_aspx.applicationinstance' hides inherited member 'login. applicationinstance'. Use the New Keyword if hiding was intended.
Source error:
Show detailed compiler output:
Show complete compilation Source:
Version Information:Microsoft. NET Framework Version: 2.0.50727.42; ASP. NET version: 2.0.50727.42
========================================================== ==========================================
This is because the login class is added to. NET Framework 2.0. When we add login. aspx, there will be a conflict.
Solution
First, change the Page Base Class Name:
Put the original
Public partial class login: system. Web. UI. Page
{
...
}
To something else, such
Public partial class accountlogin: system. Web. UI. Page
{
...
}
The changes in the aspx file must also be as follows:
<% @ Page Language = "C #" autoeventwireup = "true" codefile = "login. aspx. CS "inherits =" login "Culture =" Auto "uiculture =" Auto "%>
<% @ Page Language = "C #" autoeventwireup = "true" codefile = "login. aspx. CS "inherits =" accountlogin "Culture =" Auto "uiculture =" Auto "%>
Try again.
Second, add namespaces to the page base class.
<% @ Page Language = "C #" autoeventwireup = "true" codefile = "login. aspx. cs" inherits = "etrmsweb. login" %>
Namespace etrmsweb
{
Public partial class login: system. Web. UI. Page
{