Cannot convert type 'ASP.login_aspx' to 'System.Web.UI.WebControls.Login'

Discussion in 'ASP .Net' started by Tim Cartwright, Nov 7, 2005.

  1. I have a page that has the login control on it, nothing else. This page inherits from a master page, neither page has any code in it. This page works perfectly when running on the WebDev debug web server. I am able to log in. However after publishing the page to my local IIS, it results in the below error. This error is occurring on the Visual Studio.Net 2k5 release version, but did not occur on the beta 2, same code.

    A point of interest, is that I uninstalled IIS, then re-installed it after a recent system rebuild (which I did to completely remove the beta), and I reinstalled asp.net to IIS afterwards.

    First the html :
    ***************************************************************************************************
    ***************************************************************************************************
    <%@ Page Language="C#" MasterPageFile="~/default.master" AutoEventWireup="true" CodeFile="Login.aspx.cs" Inherits="Login" Title="Login" %>
    <asp:Content ID="Content1" ContentPlaceHolderID="content" Runat="Server">
    <asp:Login ID="Login1" runat="server" PasswordRecoveryText="Cant remember your password?" PasswordRecoveryUrl="~/RecoverPassword.aspx" DestinationPageUrl="~/Default.aspx">
    </asp:Login>
    </asp:Content>

    ***************************************************************************************************
    ***************************************************************************************************
    Cannot convert type 'ASP.login_aspx' to 'System.Web.UI.WebControls.Login'

    Event Type: Warning
    Event Source: ASP.NET 2.0.50727.0
    Event Category: Web Event
    Event ID: 1310
    Date: 11/7/2005
    Time: 10:43:16 AM
    User: N/A
    Computer: DEVPC01
    Description:

    Event code: 3007
    Event message: A compilation error has occurred.
    Event time: 11/7/2005 10:43:16 AM
    Event time (UTC): 11/7/2005 4:43:16 PM
    Event ID: 6c82372492fa42dbbbd4a0f5b794ed8d
    Event sequence: 40
    Event occurrence: 7
    Event detail code: 0

    Exception information: Exception type: HttpCompileException
    Exception message: c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\deleted\3ee2c232\4383868\App_Web_login.aspx.cdcab7d2.pfd6ysg8.0.cs(118):
    error CS0030: Cannot convert type 'ASP.login_aspx' to 'System.Web.UI.WebControls.Login'

    Request information:
    User host address: 127.0.0.1
    User:
    Is authenticated: False
    Authentication Type:
    Thread account name: DEVPC01\ASPNET

    Thread information:
    Thread ID: 1
    Thread account name: DEVPC01\ASPNET
    Is impersonating: False
    Stack trace: at System.Web.Compilation.AssemblyBuilder.Compile()

    at System.Web.Compilation.BuildProvidersCompiler.PerformBuild()
    at System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath virtualPath)
    at System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile)
    at System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile)
    at System.Web.Compilation.BuildManager.GetVirtualPathObjectFactory(VirtualPath virtualPath, HttpContext context, Boolean allowCrossApp, Boolean noAssert)
    at System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath(VirtualPath virtualPath, Type requiredBaseType, HttpContext context, Boolean allowCrossApp, Boolean noAssert)
    at System.Web.UI.PageHandlerFactory.GetHandlerHelper(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath)
    at System.Web.UI.PageHandlerFactory.System.Web.IHttpHandlerFactory2.GetHandler(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath)
    at System.Web.HttpApplication.MapHttpHandler(HttpContext context, String requestType, VirtualPath path, String pathTranslated, Boolean useAppConfig)
    at System.Web.HttpApplication.MapHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
    at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
     
    Tim Cartwright, Nov 7, 2005
    #1
    1. Advertising

  2. **crickets**
    "Tim Cartwright" <-interactive.com> wrote in message news:%...
    I have a page that has the login control on it, nothing else. This page inherits from a master page, neither page has any code in it. This page works perfectly when running on the WebDev debug web server. I am able to log in. However after publishing the page to my local IIS, it results in the below error. This error is occurring on the Visual Studio.Net 2k5 release version, but did not occur on the beta 2, same code.

    A point of interest, is that I uninstalled IIS, then re-installed it after a recent system rebuild (which I did to completely remove the beta), and I reinstalled asp.net to IIS afterwards.

    First the html :
    ***************************************************************************************************
    ***************************************************************************************************
    <%@ Page Language="C#" MasterPageFile="~/default.master" AutoEventWireup="true" CodeFile="Login.aspx.cs" Inherits="Login" Title="Login" %>
    <asp:Content ID="Content1" ContentPlaceHolderID="content" Runat="Server">
    <asp:Login ID="Login1" runat="server" PasswordRecoveryText="Cant remember your password?" PasswordRecoveryUrl="~/RecoverPassword.aspx" DestinationPageUrl="~/Default.aspx">
    </asp:Login>
    </asp:Content>

    ***************************************************************************************************
    ***************************************************************************************************
    Cannot convert type 'ASP.login_aspx' to 'System.Web.UI.WebControls.Login'

    Event Type: Warning
    Event Source: ASP.NET 2.0.50727.0
    Event Category: Web Event
    Event ID: 1310
    Date: 11/7/2005
    Time: 10:43:16 AM
    User: N/A
    Computer: DEVPC01
    Description:

    Event code: 3007
    Event message: A compilation error has occurred.
    Event time: 11/7/2005 10:43:16 AM
    Event time (UTC): 11/7/2005 4:43:16 PM
    Event ID: 6c82372492fa42dbbbd4a0f5b794ed8d
    Event sequence: 40
    Event occurrence: 7
    Event detail code: 0

    Exception information: Exception type: HttpCompileException
    Exception message: c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\deleted\3ee2c232\4383868\App_Web_login.aspx.cdcab7d2.pfd6ysg8.0.cs(118):
    error CS0030: Cannot convert type 'ASP.login_aspx' to 'System.Web.UI.WebControls.Login'

    Request information:
    User host address: 127.0.0.1
    User:
    Is authenticated: False
    Authentication Type:
    Thread account name: DEVPC01\ASPNET

    Thread information:
    Thread ID: 1
    Thread account name: DEVPC01\ASPNET
    Is impersonating: False
    Stack trace: at System.Web.Compilation.AssemblyBuilder.Compile()

    at System.Web.Compilation.BuildProvidersCompiler.PerformBuild()
    at System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath virtualPath)
    at System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile)
    at System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile)
    at System.Web.Compilation.BuildManager.GetVirtualPathObjectFactory(VirtualPath virtualPath, HttpContext context, Boolean allowCrossApp, Boolean noAssert)
    at System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath(VirtualPath virtualPath, Type requiredBaseType, HttpContext context, Boolean allowCrossApp, Boolean noAssert)
    at System.Web.UI.PageHandlerFactory.GetHandlerHelper(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath)
    at System.Web.UI.PageHandlerFactory.System.Web.IHttpHandlerFactory2.GetHandler(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath)
    at System.Web.HttpApplication.MapHttpHandler(HttpContext context, String requestType, VirtualPath path, String pathTranslated, Boolean useAppConfig)
    at System.Web.HttpApplication.MapHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
    at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
     
    Tim Cartwright, Nov 8, 2005
    #2
    1. Advertising

  3. Tim Cartwright

    sholder Guest

    Howdy,

    I hit the same issue just now...and you are the only one I could fin
    who was having the same problem. The good news is I figured it out...
    thought it might have to do with the name of the page (based on th
    error we were both receiving). I renamed my page from Login.aspx t
    MemberLogin.aspx. I recompiled and deployed. Everything worked!!!!

    Based on the name of your page I assume this will work for you.

    Good luck

    --
    sholde
    -----------------------------------------------------------------------
    sholder's Profile: http://www.highdots.com/forums/m141
    View this thread: http://www.highdots.com/forums/t307479
     
    sholder, Nov 9, 2005
    #3
  4. WOW MUAHAHAHAHAHAHHA - Interesting................. I also find this
    interesting that this code was working in Beta 2, but now is broke.

    "sholder" <> wrote in message
    news:...
    >
    > Howdy,
    >
    > I hit the same issue just now...and you are the only one I could find
    > who was having the same problem. The good news is I figured it out...I
    > thought it might have to do with the name of the page (based on the
    > error we were both receiving). I renamed my page from Login.aspx to
    > MemberLogin.aspx. I recompiled and deployed. Everything worked!!!!
    >
    > Based on the name of your page I assume this will work for you.
    >
    > Good luck!
    >
    >
    > --
    > sholder
    > ------------------------------------------------------------------------
    > sholder's Profile: http://www.highdots.com/forums/m1413
    > View this thread: http://www.highdots.com/forums/t3074792
    >
     
    Tim Cartwright, Nov 9, 2005
    #4
  5. Tim Cartwright

    Dima Guest

    Yeah! I also encontered the same problem...
     
    Dima, Nov 11, 2005
    #5
  6. Tim Cartwright

    edusabrz Guest

    Hey Guys,

    Finally, I found a group of people having the same error!
    It's been two days on this already and nothing... :(

    sholder,
    I am happy for you man, because I tried the same thing with no positive
    results.
    When changing the name of the file I also had to change web.config,
    otherwise it keeps looking for "Login.aspx", which according to MS it
    is the default login path for vs2k5.

    Hopefully, there is a different try for this... hopefully!

    Cheers

    edusabrz
     
    edusabrz, Nov 12, 2005
    #6
  7. Tim Cartwright

    edusabrz Guest

    I finally GOT IT !!!
    Simply using a different name for the page is not enough.
    Here is the solution I found on Microsoft's lab website:

    If you have used a Page that effectively uses a codebehind classname
    that is the same as say the Login control, that is Login, e.g. your
    page was called Login.aspx, then when you pre-compile (publish) the web
    site as an updateable web site, the aspx is retained and tries to
    compile against a type called Login in the code behind. It does not
    resolve to be that in the codebehind assembly

    Try using a classname for your codebehind and defined in the inherits
    that does not clash with a type in System.Web, e.g. LoginPage, or
    qualify the class and therefore the inherits statement with a
    namespace, e.g.

    <%@ page ... inherits="theNs.Login" %.

    namespace theNs { public partial class Login : System.Web.UI.Page { ..
    } }

    Now... going to the next challenge... :)

    Take care you all!

    edusabrz.
     
    edusabrz, Nov 13, 2005
    #7
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Matt
    Replies:
    2
    Views:
    857
    Matt Getting
    Jul 24, 2003
  2. Columbia Pike
    Replies:
    5
    Views:
    27,309
    Columbia Pike
    Aug 9, 2004
  3. keithb
    Replies:
    2
    Views:
    6,739
    =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
    May 31, 2006
  4. Chris
    Replies:
    1
    Views:
    1,016
    Teemu Keiski
    Feb 12, 2007
  5. Andy B
    Replies:
    2
    Views:
    3,211
    Andy B
    Apr 23, 2008
Loading...

Share This Page