Click here to Skip to main content
15,916,692 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi.. How to id my below td by programatically, not using java script function..


XML
<td align="right" id="tdDOR" runat="server">
    DOR
</td>




I searched in google also but I didn't get the right solution..

Thanks & Regards,
Honey........
Posted
Updated 27-Jun-19 0:46am
v2

Since you have the TD available on server, by setting runat="server" and do not want to use Javascript, on the Page_Load event access the td by its ID and set it visible = false i.e.,

C#
tdDOR.visible = false


or
You can set its style as well in HTML itself

ASP.NET
<td align="right" id="tdDOR" runat="server" style="display:none">
  DOR
</td>


or
You can set this style in code behind as well on Page_Load event
C#
tdDOR.attributes.add("style","display:none")



Or
You can use another style,
C#
tdDOR.attributes.add("style","visibility:hidden")
 
Share this answer
 
Comments
__TR__ 10-Dec-12 9:03am    
+5.
Hi,

try this

tdDOR.Visible = false;
 
Share this answer
 
Comments
honey4bee 10-Dec-12 8:05am    
k ... resoved for ur above line of code... thank u........

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900