I am working on Asp.Net application. Everything was working fine until when I copy pasted couple of labels on a page and tried to set text to them on server file (.cs), they were showing in intellisense but when I compiled error showed 'The name 'lbltest' does not exist in the current context'
. What could be the issue?
Asked
Active
Viewed 35 times
0

Khan
- 87
- 2
- 10
-
1The .designer.cs file can sometimes get messed up when copying and pasting controls... where you have pasted them, try something like saving the page, then edit the control, i.e. delete the close tag, save it, add the close tag save it etc etc – Paul Zahra Apr 08 '16 at 10:41
-
I tried many , but nothing works. actually I think that there some error in the code which not showing , how can I get to that error if it exist? – Khan Apr 08 '16 at 11:04
-
Have a quick look in the designer file to see if the newly added controls are there.... Run the application in debug mode, if that doesn't lead you to the issue then try the good old process of elimination; add one control at a time and test it. – Paul Zahra Apr 08 '16 at 11:06
-
Your issue is nothing new, lots of people over the last 8 years have experienced it... Read this: http://stackoverflow.com/questions/706603/the-name-controlname-does-not-exist-in-the-current-context and read this: http://stackoverflow.com/questions/706603/the-name-controlname-does-not-exist-in-the-current-context/1981228#1981228 – Paul Zahra Apr 08 '16 at 11:08
-
My old controls are working fine. Error is only occuring with the newly added controls – Khan Apr 08 '16 at 11:20