1

Using the advise given on this post...

Creating an ASP.Net Templated Server control

... I was able to create a nice templated server control.

However, what I noticed is that on some templated controls such as the ASP.Net UpdatePanel you dont need to use FindControl to find the actual control inside your template. UpdatePanel has a template (or similar) and this just allows dirrect access to your controls without using the FindControl method that I have to use on the templated control I have created.

How do I make my control like the update panel where no template is needed?

Thanks.

Community
  • 1
  • 1
Remotec
  • 10,304
  • 25
  • 105
  • 147
  • This blog entry finally solved the problem: http://weblogs.asp.net/zeeshanhirani/archive/2008/05/31/use-templateinstance-single-to-avoid-findcontrols.aspx – Remotec Apr 24 '11 at 14:37

1 Answers1

1

You use a template, but add [TemplateInstance(TemplateInstance.Single)] to the property with the ITemplate and that should solve that issue:

http://msdn.microsoft.com/en-us/library/system.web.ui.templateinstanceattribute.aspx

HTH.

Brian Mains
  • 50,520
  • 35
  • 148
  • 257