Reputation: 131
I have a div
like this:
<div id="1" class="2" no="3" type="4"></div>
i want get property no
and type
in ASP.net.
please help me.
Upvotes: 0
Views: 4541
Reputation: 41
Add the runat="server" attribute to the div and access the other attributes in code-behind like this: string attr = divId.Attributes["attrName"];
If you are adding the attributes with javaScript, make sure to run this code after the javaScrip has added them. Otherwise you might get a null refference exception.
Upvotes: 1