| re: Visual Studio forgets about variable declarations
1. check whether the proctection level of the declared variables is at least
Protected.
2. This problem may also occur if you manually delete the control from the
code behind file and do some operation and again paste the declaration so in
this case, just check whether you have proper event handler in the
InitializeComponent() method.
If still you face the problem then please give some more details, like the
exact Page attribute that you are having in your aspx page.
Whether you are creating control by dragging them from the toolbox or you
are adding them in code.
and at what point of time you are getting this error.
Hope this Helps!
"Nick Stansbury" wrote:
[color=blue]
> Hi,
>
> I'm not sure where to post this - but I'll try here. I'm encountering
> some really weird behaviour in visual studio and I can't work out where it
> is coming from.
>
> In various files, seemingly at random, the compiler seems to "forget" about
> references declared in the code behind file. So when I build I get a whole
> string of errors like "dgdSearchResults is not defined", but if I right
> click -> goto definition it goes straight to the declaration in the code
> behind file.
>
> Sometimes rebuilding the solution solves the problem, but at other times I
> have to delete the declaration and paste it in again somewhere else.
>
> Has anyone encountered this? It seems to be on just one machine (mine) and
> not on any of the other developers. It seems to only occur in the one
> project.
>
> Nick
>
>
>[/color] |