Reputation: 121
I have a HTML hidden field:
<input type="hidden" title="aaa" value="bbb" id="TAB" runat="server" />
I want to access the title attribute from the code behind, like if its a input="text", there is a option TAB.ToolTip, but not for "hidden". Is it possible to get the title since it exists like an attribute?
Upvotes: 1
Views: 2419
Reputation: 5975
I assume that your control is recognized by the webserver as a HtmlInputHidden instance. You should be able to fetch all attributes of the control using the Attributes property (see http://msdn.microsoft.com/en-us/library/system.web.ui.htmlcontrols.htmlcontrol.attributes(v=vs.90))
In you code behind:
TAB.Attributes["title"] = "aaa";
Upvotes: 1