Controls within SingleInstance Template properties show in red

I have encountered a ReSharper 4 bug with its ASP.NET parser. If I have a control that has a property of type ITemplate, and also has a attribute on it like this:



public ITemplate Footer
{
get { return _footer; }
set { _footer = value; }
}

Then if I have this code in my code in front:

]]>

Then in the code behind, I should be able to set properties of the myFooterText Literal control just like any other control:

myFooterText.Text = "my content";

However, ReSharper incorrectly highlights the myFooterText token in red saying it is not defined. While its true that if the ITemplate property did not have the TemplateInstance.Single attribute on it, that would be the correct behavior, the existence of that attribute should make the controls inside the template directly accessible from the code behind. For an example of an official ASP.NET control that uses this technique, see the UpdatePanel.

I have attached a sample solution that illustrates the problem.

~Andy



Attachment(s):
SingleInstanceTemplateBug.zip
2 comments
Comment actions Permalink

Andy,

I've created a request http://www.jetbrains.net/jira/browse/RSRP-65319
Unfortunately, we aren't able to fix it in 4.0, but we'll definitely fix it
in the future version.

--
Sergey V. Coox
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"


0
Comment actions Permalink

Hello Sergey,

Bummer that it can't get into 4.0. Thanks for logging it.

BTW, overall, I am very impressed with 4.0. It seems snappier and more responsive
for web projects overall. Thanks for all of your hard work!

~Andy

Andy,

I've created a request http://www.jetbrains.net/jira/browse/RSRP-65319
Unfortunately, we aren't able to fix it in 4.0, but we'll definitely
fix it in the future version.



0

Please sign in to leave a comment.