Reputation: 4898
My app today started throwing the following error:
The name 'Control' does not exist in the current context
It's happening only in 2 controls in the page, even if I rename them. If I add the control declaration myself in the .designer.cs
file it works but when rebuilt it throws the error again.
Any ideas what might be wrong? I can paste all the code but I feel there's just too much to paste, but if you want me to post some of the code just tell me.
Upvotes: 2
Views: 96
Reputation: 11201
The designer file for an aspx sometimes does no correctly write code for controls. so in such a case delete the designer file then right click on you .aspx file and Click "Convert to Web Application" this action regenerates the designer file again correctly
Upvotes: 1
Reputation: 16310
You should check the code behind the filename and inherits property on @Page directive and ensure that they both match....
You should also be sure to exclude other page which is referncing to same code behind file...
Upvotes: 0