markouuu
markouuu

Reputation: 121

Access input hidden field Title attribute from code behind

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

Answers (1)

KBoek
KBoek

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

Related Questions