Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

codebehind cannot reference the page controls

I have controls in ascx file but i can't see them in intellisense in .cs file.It was working nice before.

I can see the control names in designer.cs file.

I have deleted the Asp.net temp files in AppData folder but still not working.The other user control files in the app can reference coerrectly to it's page controls. What is the problem here ? I use VS2008.

like image 550
zer0w1dthspace Avatar asked Feb 27 '26 03:02

zer0w1dthspace


1 Answers

Look at the top line of the .ascx page and check out the value of Inherits= and make sure that is has the right namespace.class appropriate for your codebehind. For example if your namespace is ProjectNamespace and your control class is MyControl then it should be ProjectNamespace.MyControl. This can get out of synch if you renamed the ascx file, etc and cause this type of problem.

like image 78
Nick Avatar answered Feb 28 '26 22:02

Nick