Click here to Skip to main content
15,891,567 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am using a master page where i add a panel. But i need to hide this panel in a page which is under this master page.

please help me how can i do this.

Thanks in advance
Posted
Comments
raju melveetilpurayil 27-Jun-11 4:31am    
I think you want to hide master page content form content page?

1 solution

To hide master page content form content page, we can hide control
1: from Server
2: from Client

1:Server side or from Content Page, button click or some other event

C#
Panel p= Master.FindControl("pnlPanel") as Panel;
       if (p != null)
       {
           p.Visible = false;
       }


2: from Client


XML
<input id="Button2" type="button" value="From Client" onclick="hide();" />
   <script >
       function hide() {
           document.getElementById("pnlPanel").style.display = 'none';
       }
   </script>
 
Share this answer
 

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