Click here to Skip to main content
15,891,473 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I am working in asp.net web project, i have a scenario where i have to hide some and some time full content of a web page from user. I have worked divs .
Can this be possible if yes then how, if not then is there any other way to doing this.
Posted

I think if you give id for div tags and an attribute of runat="server" to them,
maybe you can hide them in code behind by setting the visible property for that div to false.
 
Share this answer
 
It is possible. There are many ways to do so. 1 way is posted above, or you may use either JavaScript or JQuery. Now its depends on you which way to prefer. I suggest you to use code behind approach, if you don't have any such special requirement.
 
Share this answer
 
You can do it by server side as well client side

If you want it as a server side that try

Solution 1



And if you want to use by client side that you can set display property of a Div's Style using javascript like that.. :)

JavaScript
document.getElementById("DivID").style.display="none";  //InVisible

document.getElementById("DivID").style.display="";  //Visible

or

document.getElementById("DivID").style.display="block";  //Visible


Regards,

Nirav Prabtani

 
Share this answer
 
v2
Comments
Muhammad Taqi Hassan Bukhari 12-May-14 7:34am    
What if i have to do it on server side.
Nirav Prabtani 12-May-14 7:38am    
try Solution 1 for that

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