473,464 Members | 1,729 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

UpdatePanel in masterPage in Wcsf enable/Disable problem

7 New Member
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(DefaultC ontent);
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 Error is displayed.by the Internet Browser,
First the .aspx page is loaded then the Page_load 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
Sep 7 '07 #1
0 1092

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Diane Yocom | last post by:
I'm trying to use an Atlas UpdatePanel to just update a label when a text box has changed. The problem is that my textbox is in a user control and I'm using Master Pages - with the combination of...
2
by: Rissoman | last post by:
I have two user controls on a master page. I can easily bubble up an event on usercontrol 1 from a click event to the page.aspx, than then calls a method on the masterpage, but this causes the...
0
by: Kevin | last post by:
Hi! I'm trying to insert a UpdatePanel (Ajax) inside a Content (masterpage child) but the Visual Studio designer take it as not known element. In the masterpage the UpdatePanel works ok. ...
6
by: Roland Dick | last post by:
Hi, this must have been asked a thousand times, but for some reason I couldn't find anything on this.. I have an ASP.NET 2 website with a masterpage, which contains some navigation links...
1
by: zb | last post by:
Scenarion: In an ASPX page I have a user control embedded (actually embedded in MasterPage), based on completion of a AJAX call in the user control it needs to update a Grid view which is actually...
3
by: =?Utf-8?B?U2FuZHBvaW50R3V5?= | last post by:
I have a masterpage named MasterpageController with a menu. In the codebehind I have a method SetMasterMenu(<some parms>) to display the appropriate menu items. The content page, which has a...
4
by: pechar | last post by:
Hi All, This question has been asked many times and I've checked most of the sites with resolutions. None worked for me. 1) I have a page which is a content page to a Masterpage . 2) I have a...
3
by: =?Utf-8?B?Y21lZWsxXzE5OTk=?= | last post by:
Hello, On a webpage, create an UpdatePanel with two DropDownLists. Set AutoPostBack of DropDownList1 to true. In the SelectedIndexChanged method, refill DropDownList2 and set the focus to...
9
by: TimVtoo | last post by:
asp VB.NET How can I pass a value to my user controls in the example below From the Master Page?... it's driving me nuts! The scenario: <MasterPage> <UpdateTrigger/> <ContentPlaceHolder...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.