UpdatePanel in masterPage in Wcsf enable/Disable problem

Sep 7, 2007 at 12:32 PM
Hi ,

I have to add the Updatepanel to the Master page in which the DefultContenPanel have to be in it, base on some condition .
If the condition is flase then the UpdatePanel should not work,
Here is the code .of MasterPage

protected void Page_Load(object sender, EventArgs e)
{
if (this.Page.Application"Javascript".Equals("Enabled"))
{
MasterUpdatePanel.Visible = true;
UpdatePanel up1 = new UpdatePanel();
up1.ID = "MasterUpdatePanel";
up1.UpdateMode = UpdatePanelUpdateMode.Conditional;
ContentPlaceHolder contentplaceholder = new ContentPlaceHolder();
contentplaceholder.ID = "DefaultContent";
up1.ContentTemplateContainer.Controls.Add(DefaultContent);
Page.Form.Controls.Add(up1);
}
else
{
Panel panel = new Panel();
panel.ID = "Panel1";
panel.Width = Unit.Percentage(100);
panel.Height = Unit.Percentage(100);
ContentPlaceHolder DefaultContent = new ContentPlaceHolder();
DefaultContent.ID = "DefaultContent";
panel.Controls.Add(DefaultContent);
}
}
But when run the application the "DefaultContent" is note found BError/B is displayed.by the Internet Browser,
First the B.aspx/B page is loaded then the BPage_load/B function is called,
So is there any way i can do it in master page, so that i can decide in runtime, where the ContenPlaceHolde ie"DefaultContent" should be .

Thanks in adavances.

Anil S G