I have some admittedly weird code that Resharper isn't parsing correctly, but which compiles correctly. It looks something like this:
At the top of the ascx page, there's a client side script block, but note that it has an asp:Literal definition embedded in it:
<script language=javascript>
var dirty = true;
function finish()
{
if (dirty && window.opener)
{
var buttonId = '<asp:Literal id="ButtonId" runat="server"></asp:Literal>';
var button = window.opener.document.getElementById(buttonId);
if (button == null && window.opener.dialogWin.args != null)
{
button =
window.opener.document.getElementById(window.opener.dialogWin.args);
}
if (button != null)
button.click();
window.close();
}
}
In the code-behind *.ascx.cs file, the identifier "ButtonId" is comming up as undefined and colored in red. The compiler compiles it fine, however, so it's NOT undefined.
I think the Resharper parser is balking at the idea of
the <asp:Literal ..../> definition being inside the script block, and
further, inside quotes of a variable assignment. This doesn't matter to the ASP.NET parser, and it shouldn't matter to Resharper either. That line still defines an asp page element, and thus should still be parsed and recognized and properly colored.