Click here to Skip to main content
15,899,124 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,



i just wanna know about how to get hide div tag at run time.

for ex:


<asp:textbox id="txt1" run="server">




i didn't provide runat="server" in div tag.. because i had using a script.. the script is not working if am using runat= "server" in that div tag



plz tell me one solution
Posted
Comments
Nirav Prabtani 3-Jul-13 3:16am    
If you can not execute your need with Div try to use Panel instead...:)

Then register a script and set visibility of div to hidden. Try like this:
C#
Page.ClientScript.RegisterStartupScript(this.GetType(), "clientscript", "document.getElementById('YourDivID').style.visibility = 'hidden';" ,true);



--Amit
 
Share this answer
 
Hi,

I think you can use jQuery to hide the div.

$("#divID").hide();

Thank You
 
Share this answer
 
Register script in .cs file and set runat="server" to that div.
If not working paste you code and script.
 
Share this answer
 
v4
Add runat="server" attribute in div
and at codebehind(.cs for c sharp .vb for visual basic) use below code
C#
divid.visible=false


for scripting purpose you need to register your script and use your div's client id .you can find client id using browser or using clientId method of javascript
 
Share this answer
 
v2

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