Cannot convert type 'ASP.login_aspx' to 'System.Web.UI.WebControl'

2008-04-30


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. in the .aspx file:

<%@ page ... inherits="MyNameSpace.Login" %. in the code behind file:

namespace MyNameSpace

{ public partial class Login : System.Web.UI.Page

{

..

}

}