Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

setting display property in the code behind

Tags:

c#

asp.net

How can i set the display property to block in the code behind?

<asp:Panel ID="pnlHedgingTypeI"  Style="display:none" runat="server">

pnl.Attributes.Add("display", "block");  

is not helping me ..Could you please help me to resolve this?

like image 633
Sumeru Suresh Avatar asked Sep 24 '09 11:09

Sumeru Suresh


2 Answers

You can also do

pnl.Style["display"] = "block";
like image 72
rahul Avatar answered Oct 03 '22 02:10

rahul


pnl.Attributes.Add("style", "display:block"); is correct ... got it.

like image 36
Sumeru Suresh Avatar answered Oct 03 '22 02:10

Sumeru Suresh