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


In My Master Page There is one menu strip when i click on this menuitem i want to set
the Panel1.visible=true but this panel is on the Default page means on the child page .

How can set this property.

Thank's....
Posted

In OnClick event associated with you menu item by using this.Page you will have access to the current web page, than you could test if is your default page and convert to it and you will have access to its public properties and methods like below:
C#
if( this.Page is DefaultPage)   //Here must be the name of your "Default Page" class!
{
    DefaultPage myPage = (DefaultPage)this.Page;
    myPage.Panel1.Visible = true;
}
 
Share this answer
 
Comments
basurajkumbhar 11-Dec-14 1:52am    
Thanks for reply but this is not working

I want to access the child page control on master page click event or page load
Raul Iloc 11-Dec-14 1:55am    
You should access the page class, like I detailed in my solution above, than you must have public properties/method in page class that gave you access to the control.
You can expose Panel1 as a property from your child page then use this property to set the visibility as per your need.
 
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