系统里有一个叫Login.aspx的文件,开发测试的时候没有任何问题,发布网站,运行时提示"无法将类型“ASP.login_aspx”转换为“System.Web.UI.WebControls.Login",页面上更本就没有Login控件,于是我将发布改为不允许更新此预编译站点发布后正常,于是找了一些资料,发现有个解决方法,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 { ..
} } 不知道各位有没有碰到过这样的问题...
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 { ..
} } 不知道各位有没有碰到过这样的问题...
解决方案 »
- 把密码显示成"*"怎么改?有人知道嘛?帮帮忙
- 请教:关于后台添加滚动图片的问题.
- 为什么asp.net2.0页一提交就变形
- 急啊!帮忙.....
- 问一个SQL的问题,,那位大哥说说
- 树形控件
- 在ASP.NET中,如何能选取当前系统下所有的指定文件类型的文件?比如说:要选取所有的文本文档的文件,该如何操作,要将他们存入DATASET中又要
- dropdownlist级联菜单问题
- 我第一天学习asp.net:asp.net数据库根本就不会。
- team foundation server 2010问题
- 一个网站需要登陆才能看到里面的页面,我有用户名和密码,如何得到这个网站的HTML源文件呢?
- 小弟准备学.NET,请大家提点意见,好吗?
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 说的很清楚了~~Codebehind的aspx如果叫Login就有这个麻烦
应该算是BUG,Framework的BUG
呵呵
不过估计是bug