473,396 Members | 1,834 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

AJAX Master page issue.

I have set up a updateprogress on my master page. It contains a
label, so I can give page-appropriate messages while updates are going
on. However, I cannot update the label.

Here is the master page:
<body>
<form id="Main" method="post" runat="server">
<div class="Header"></div>
<asp:ScriptManager ID="ScriptManager1" runat="server"></
asp:ScriptManager>
<asp:UpdatePanel ID="upnlMain" runat="server"
UpdateMode="Conditional">
<ContentTemplate>
<div style="width:100%; height: 216px; font-size:medium"
align=center>
<br />
<asp:label id="lblMessage" runat="server" Width="100%" Font-
Size="X-Large"></asp:label>
<asp:UpdateProgress ID="UpdateProgress1"
runat="server" >
<ProgressTemplate>
<asp:Label ID="lblProgressMsg"
runat="server" Text="An update is in progress...">
</asp:Label>
</ProgressTemplate>
</asp:UpdateProgress>
<br />
<asp:ContentPlaceHolder ID="cphMain"
runat="server">
</asp:ContentPlaceHolder>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</form>
</body>
Here is the code to try to change lblProgressMsg:

Dim up1 As UpdatePanel = DirectCast(Master.FindControl("upnlMain"),
UpdatePanel)
If Not (up1 Is Nothing) Then
Dim up2 As UpdateProgress =
DirectCast(up1.FindControl("UpdateProgress1"), UpdateProgress)
If Not (up2 Is Nothing) Then
Dim lblProgressMsg1 As Label =
DirectCast(up2.FindControl("lblProgressMsg"), Label)
If Not (lblProgressMsg1 Is Nothing) Then
Update_Message("Changing")
lblProgressMsg1.Text = "Hello"
Else
Update_Message("Label is Nothing")
End If
Else
Update_Message("up2 is Nothing")
End If
Else
Update_Message("up1 is Nothing")
End If

Update_Message sub finds and update lblMessage. This works correctly
EVERY time.
However, lblMessage ALWAYS says "Label is Nothing", no matter what I
try.

Any ideas or suggestions?

Thanx in advance,
Stephen Cottingim
sc********@nospam.hotmail.com (remove the appropriate parts before
sending. ;) )
Jun 27 '08 #1
4 1722
The only thing I can think of is that you're updating the label and
then somewhere in your updatepanel.load event or your page.load event
you're changing it back.
Jun 27 '08 #2
On Apr 22, 2:50*pm, "cfps.Christian" <ge0193...@otc.eduwrote:
The only thing I can think of is that you're updating the label and
then somewhere in your updatepanel.load event or your page.load event
you're changing it back.
I think you misunderstood my message. lblMessage, a generic label on
the page for page messages to the reader, always says "Label is
Nothing" That means that it cannot find lblProgressMsg, the label in
the UpdateProgress object, which is what I am trying to update.
Jun 27 '08 #3
as the updateprogess is not in the update panel (the only html modified on a
aync postback), its label is fixed at the first render. an async postback
that updates the master page control have no effect as its html is not
re-rendered

-- bruce (sqlwork.com)
"sc********@hotmail.com" wrote:
I have set up a updateprogress on my master page. It contains a
label, so I can give page-appropriate messages while updates are going
on. However, I cannot update the label.

Here is the master page:
<body>
<form id="Main" method="post" runat="server">
<div class="Header"></div>
<asp:ScriptManager ID="ScriptManager1" runat="server"></
asp:ScriptManager>
<asp:UpdatePanel ID="upnlMain" runat="server"
UpdateMode="Conditional">
<ContentTemplate>
<div style="width:100%; height: 216px; font-size:medium"
align=center>
<br />
<asp:label id="lblMessage" runat="server" Width="100%" Font-
Size="X-Large"></asp:label>
<asp:UpdateProgress ID="UpdateProgress1"
runat="server" >
<ProgressTemplate>
<asp:Label ID="lblProgressMsg"
runat="server" Text="An update is in progress...">
</asp:Label>
</ProgressTemplate>
</asp:UpdateProgress>
<br />
<asp:ContentPlaceHolder ID="cphMain"
runat="server">
</asp:ContentPlaceHolder>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</form>
</body>
Here is the code to try to change lblProgressMsg:

Dim up1 As UpdatePanel = DirectCast(Master.FindControl("upnlMain"),
UpdatePanel)
If Not (up1 Is Nothing) Then
Dim up2 As UpdateProgress =
DirectCast(up1.FindControl("UpdateProgress1"), UpdateProgress)
If Not (up2 Is Nothing) Then
Dim lblProgressMsg1 As Label =
DirectCast(up2.FindControl("lblProgressMsg"), Label)
If Not (lblProgressMsg1 Is Nothing) Then
Update_Message("Changing")
lblProgressMsg1.Text = "Hello"
Else
Update_Message("Label is Nothing")
End If
Else
Update_Message("up2 is Nothing")
End If
Else
Update_Message("up1 is Nothing")
End If

Update_Message sub finds and update lblMessage. This works correctly
EVERY time.
However, lblMessage ALWAYS says "Label is Nothing", no matter what I
try.

Any ideas or suggestions?

Thanx in advance,
Stephen Cottingim
sc********@nospam.hotmail.com (remove the appropriate parts before
sending. ;) )
Jun 27 '08 #4
On Apr 22, 4:08*pm, bruce barker
<brucebar...@discussions.microsoft.comwrote:
as the updateprogess is not in the update panel (the only html modified ona
aync postback), its label is fixed at the first render. an async postback
that updates the master page control have no effect as its html is not
re-rendered

-- bruce (sqlwork.com)
I think I understand what you are saying. However this code is in the
page_load event. I am not trying to change the message after a
submission. I want it to use the same message on every update. I
have tried the code in the load event, the preinit event, and the
prerender even. None of them worked.
Jun 27 '08 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Von Shean | last post by:
I have a website that i have migrated VS 2003 to VS 2005. I have done some work like adding master pages and making rest of the pages as content pages. However, now i want the site to be...
9
by: RBM007 | last post by:
Hello, I have created some pages in the (old) Atlas pages and migrated to AJAX version. After the update I noticed that any page containing ASP.NET AJAX won't compile anymore. Even if the same...
3
by: Shailesh Patel | last post by:
Hi, Where can I find good tutorial for AJAX with Masterpages. Thank you in advance. Shailesh
6
by: mike | last post by:
I'm having a problem getting AJAX working with a master page. I have created a new website using the AJAXControlToolkit template and default.aspx as follows. <%@ Page Language="C#"...
1
by: =?Utf-8?B?TGFycnkgRXBu?= | last post by:
I have an app using Ajax. The scriptmanager is within the form that is within the master page. I also have web user controls that are doing partial rendering and are "borrowing" or "inheriting"...
0
by: Phillip Ian | last post by:
Tried this over in CSharp.General and didn't get anything, so I thought I'd try again here. If there's an AJAX specific group I could ask this in, please let me know...I did look. I'm trying to...
3
by: Mike TI | last post by:
Oct 20, 2007 01:00pm Hi all When you create an Ajax enabled web site, the application creates the default page with a "Script Manager". I created a Master Page. I then created a "Home"...
2
by: =?Utf-8?B?REo=?= | last post by:
I have a peculiar problem here that I did not have until I migrated from ASP.NET 2.0 to 3.5. I use a master page for my application. Because the master page uses update panels I have the...
10
by: =?Utf-8?B?RGFuaQ==?= | last post by:
Hi, Trying to create a master page that holds a menu, and the menu switches between pages in the site. 2 problem arrosed: a. When I navigate from page to page (all AJAX Web Forms, with the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.