本文介绍了是否可以模拟HTML标签<标签/>在ASP:标签ASP.NET控件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我真的很喜欢的HTML标记,这使得它可以很方便地看到哪个标签通过检查'的'属性代表该input元素。你知道的,是这样的:
I really like the HTML tag which makes it really easy to see which label stands for which input element by checking its 'for' attribute. You know, something like:
<label for="txtInput"> Enter your name</label>
<input type="text" id="txtInput" />
是否有可能做asp.net Label控件类似的东西,这样我可以看到所代表的输入控制?我看不出该属性。不延长控制?
Is it possible to do something similar in asp.net Label control so that I can see it stands for what input control? I could not see an attribute for that. Without extending the control?
谢谢!
推荐答案
http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.label.associatedcontrolid.aspx
<asp:label AssociatedControlID="textbox1" runat="server" id="lblOne" />
<asp:textbox id="textbox1" runat="server" />
未经测试,但沿着这些线路...
Not tested but along those lines...
这篇关于是否可以模拟HTML标签&lt;标签/&GT;在ASP:标签ASP.NET控件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!