开发者

Asp.Net - User control with text between blocks

开发者 https://www.devze.com 2023-01-22 14:19 出处:网络
I want to create a usercontrol that behaves like the Label usercontrol or the HyperLink usercontrol. What I mean - the Label usercontrol has the Text attribute, and the text can also be set with the

I want to create a usercontrol that behaves like the Label usercontrol or the HyperLink usercontrol.

What I mean - the Label usercontrol has the Text attribute, and the text can also be set with the following way:

<asp:Label runat="server" id="lblTest">Text Here</asp:Label>

If I wish to create a usercontrol that can set the开发者_Python百科 text between blocks to the actual Text attribute of the control.

Do I need to use Templated UserControl? If no - what is the correct way?

Thanks all.


I would create a simple custom control with the text attribute exposed as a property :-)

http://msdn.microsoft.com/en-us/library/aa310915%28VS.71%29.aspx

0

精彩评论

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