views:

19

answers:

1

Hi,

Using the advise given on this post...

http://stackoverflow.com/questions/2908260/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.

+1  A: 

Hey,

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