T
tofu.captain
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
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