开发者

ASP.Net Templated Server Controls difference between UpdatePanel and other controls

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 th开发者_JS百科e templated control I have created.

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

Thanks.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜