Cannot convert type ‘ASP.login_aspx’ to ‘System.Web.UI.WebControls.Login’
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 Error:
Line 120: public security_login_aspx() {
Line 121: string[] dependencies;
Line 122: ((Login)(this)).AppRelativeVirtualPath = "~/security/login.aspx";
Line 123: if ((global::ASP.security_login_aspx.@__initialized == false)) {
COMMENTS:
I got this ugly output when I published my Website from within Visual Studio 2005 using the right-click>Publish Website option. I thought maybe its a clash of names – cause these look basically the same i.e. Login.
Be careful when naming aspx pages!
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 { .. } }
Many Thanks
The Web Platform and Tools Team.
Hope this helps you if you get this error. If you need anymore clarification then feel free to post a comment with your question.
Yellow Duck Guy
Greg Olsen
Renaming the Login.aspx page worked.Also IMPORTANT, remember to rename all code that refers to the login page especially your Response.Redirect("~/Login.aspx") lines. Then test all such to prevent the unexpected but inevitable. Thanx Greg
good