S
scottingim
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
(e-mail address removed) (remove the appropriate parts before
sending. )
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
(e-mail address removed) (remove the appropriate parts before
sending. )