开发者

Why are all my ASP.NET element references undefined?

开发者 https://www.devze.com 2023-04-03 19:43 出处:网络
For some reasons I don\'t know all the el开发者_JS百科ements references in my .aspx.cs are undefined. For example:

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

精彩评论

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

关注公众号