Visual Studio .NET 2005 reports false error



I'm using Visual Studio .NET 2005 with a C# Web Application project. I
have an ASPX page that uses a MasterPage file for a general site
layout. That works just fine, but when I run a compile of the ASPX
page (say default.aspx) with something like:

<asp:Label id="lblFoo" runat="server" />

and have it's codebehind have:

protected void Page_Load(object sender, EventArgs e)
{
this.txtFoo.Text = "this works";
}

However, when I run a compile, the Error List reports that:
'Default' does not contain a definition for 'txtFoo'

when clearly there is. The problem is that the project compiles and
runs fine, but the error list is reporting an incorrect error. Does
anyone else have a similar problem with VS.NET 2005? Is this a bug in
the IDE?

Some added notes:
- I do have multiple Default.aspx across my project, but they are in
different folders and I have checked that all referencing paths are
correct.
- I did copy & paste some code from a different page into this ASPX
page, and started noticing this bug, but I have commented out such code
and still get this problem running the above example. Is there a bug
with copying & pasting code from another ASPX page that runs something
similar to what I have above?

Thanks so much

.



Relevant Pages

  • Re: Visual Studio .NET 2005 reports false error
    ... The designer class that's "supposed" to have the declarations of your page's ... but when I run a compile of the ASPX ... page, and started noticing this bug, but I have commented out such code ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Visual Studio .NET 2005 reports false error
    ... but when I run a compile of the ASPX ... 'Default' does not contain a definition for 'txtFoo' ... page, and started noticing this bug, but I have commented out such code ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Visual Studio .NET 2005 reports false error
    ... but when I run a compile of the ASPX ... and have it's codebehind have: ... page, and started noticing this bug, but I have commented out such code ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Help - client side validation not working, driving me MAD!
    ... With respect to the formName....that's not a bug. ... fact that the form on your ASPX page is not named with the "id" ... automated testing tools which depend on the full JavaScript object name ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Help - client side validation not working, driving me MAD!
    ... I was surprised to think that such a bug could have got this far!! ... fact that the form on your ASPX page is not named with the "id" attribute. ... If you use need the form's name, you can use the ClientId property of that as well. ... Alan Silver. ...
    (microsoft.public.dotnet.framework.aspnet)