开发者

Why are all my ASP.NET element references undefined?

For some reasons I don't know all the el开发者_JS百科ements references in my .aspx.cs are undefined. For example:

In MyPage.aspx I have <asp:TextBox runat="server" ID="UserName" /> and in MyPage.aspx.cs I do UserName.Text="abc". Then after building I get an error that sais: The name 'UserName' does not exist in the current context.

Why are all my ASP.NET element references undefined?

Even in my Global.asax I get an error that sais the characters are not recognized:

Why are all my ASP.NET element references undefined?

I really don't know what it is, maybe something with my namespaces or something like that. But as I see - all the namespaces are correct.

How can I solve those errors?


If you've added some of the *.aspx and *.ascx files from another project, check that the build action of the *.aspx.designer.cs and *.aspx.cs files are set to compile.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜