Priority
Critical
Type
Bug 
State
Can't Reproduce 
Assignee
Sergey Coox 
Subsystem
No subsystem 
Affected versions
Fixed in
Fixed in build
Next build 
Build
465
  • Submitted by   Jeremy Lew
    2 years ago (18 Jun 2007 20:25)
  • Updated by Jeremy Lew
    2 years ago (29 Jun 2007 15:37)
  • Jira: RSRP-43579
    (history, comments)

RSRP-43579

ReSharper incorrectly thinks that ASP.NET server controls declared in data-binding templates are declared at the page level

0
ASP.NET WebForm:
<asp:DataGrid OnItemDataBound="OnDataBound" ..etc..>
<ItemTemplate>
<asp:Textbox id="foo"/>
</ItemTemplate>
</asp:DataGrid>

Codebehind:

protected void OnDataBound( object sender, DataGridItemEventArgs e )
{
Textbox foo = e.Item.FindControl( "foo" ); // <--- declaration of variable foo is flagged as hiding the field of the same name
}

ReSharper does not recognize that foo only exists in the template section of the control, and that there is no page.foo field. It will flag the line above as a warning and also incorrectly provide intellisense for a field named foo at the page class level, even though it doesn't really exist.



Issue was closed
Comments (0)
 
History (0)
 
Links
 
Issue has no comments