Master and its Content Page

Posted by kaur87gaganjyot-9012 under Regular Expressions on 2/17/2011 | Points: 10 | Views : 1302 | Status : [Member] | Replies : 5
This below code is runing good but I want ti assign value to visibility property of panel's from master page, pannel's placed on content page.

Code of content page

public partial class _Default : System.Web.UI.Page
{

public void Page_Load(object sender, EventArgs e)
{

}
public void LinkButton1_Click(object sender, EventArgs e)
{
Panel3.Visible = false;
Panel4.Visible = false;
Panel5.Visible = false;
Panel2.Visible = true;
}
public void LinkButton2_Click(object sender, EventArgs e)
{
Panel2.Visible = false;
Panel4.Visible = false;
Panel5.Visible = false;
Panel3.Visible = true;
}
public void LinkButton3_Click(object sender, EventArgs e)
{
Panel2.Visible = false;
Panel3.Visible = false;
Panel5.Visible = false;
Panel4.Visible = true;
}
public void LinkButton4_Click(object sender, EventArgs e)
{
Panel2.Visible = false;
Panel3.Visible = false;
Panel4.Visible = false;
Panel5.Visible = true;
}
}




Responses

Posted by: Karthikanbarasan on: 2/17/2011 [Member] [Moderator] [Microsoft_MVP] [MVP] Silver | Points: 25

Up
0
Down
Hi,

Can you breif your requirement?

Thanks
Karthik
www.f5Debug.net

kaur87gaganjyot-9012, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: kaur87gaganjyot-9012 on: 2/17/2011 [Member] Starter | Points: 25

Up
0
Down
i had developed web application in which i have 1 master page and its 4 content pages. i have placed some panel's on content page. At a single time only one panel visible property will b true. its running good when i m doing it with some link on content page. m trying to do it again ,but this time i want the visible property of panel set to TRUE or FALSE from master page.

problem m facing is the panel's that are placed on content page is not accesible on master page so how can i set the visible property of content page panel from master page, so that i can save to giving the multiple link to my web application.

kaur87gaganjyot-9012, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Karthikanbarasan on: 2/17/2011 [Member] [Moderator] [Microsoft_MVP] [MVP] Silver | Points: 25

Up
0
Down
Hi,

Can you try like this... Even im not sure... try it out

ContentPlaceHolder1.FindControl("Panel1"), panel).Visible = false

Thanks
Karthik
www.f5Debug.net

kaur87gaganjyot-9012, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Madhu.b.rokkam on: 2/17/2011 [Member] [MVP] Bronze | Points: 25

Up
0
Down
Please refer to this

http://www.codeproject.com/KB/aspnet/Master_and_Contents.aspx

You will get the idea.

Thanks and Regards
Madhu

kaur87gaganjyot-9012, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: kaur87gaganjyot-9012 on: 2/18/2011 [Member] Starter | Points: 25

Up
0
Down
Hi,

Thanks for your reply but there is error with following code that is "object refference not set to an instance"

ContentPlaceHolder1.FindControl("Panel1"), panel).Visible = false;

and what is 'panel' here,is this class,object then there is a error.

And m using ASP.NET with C#.

Thanks
Gaganjyot Kaur

kaur87gaganjyot-9012, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response