Cs0030: cannot convert type 'asp. login_aspx 'to 'System. Web. UI. webcontrols. Lo

Source: Internet
Author: User
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
{

  

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.