AJAX Master page issue.
am 22.04.2008 18:20:19 von 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:
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
scottingim@nospam.hotmail.com (remove the appropriate parts before
sending. ;) )
Re: AJAX Master page issue.
am 22.04.2008 20:50:54 von ge0193387
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.
Re: AJAX Master page issue.
am 22.04.2008 21:21:45 von scottingim
On Apr 22, 2:50=A0pm, "cfps.Christian" wrote:
> 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.
RE: AJAX Master page issue.
am 22.04.2008 22:08:17 von brucebarker
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)
"scottingim@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:
>
>
>
>
>
> 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
> scottingim@nospam.hotmail.com (remove the appropriate parts before
> sending. ;) )
>
Re: AJAX Master page issue.
am 22.04.2008 22:34:59 von scottingim
On Apr 22, 4:08=A0pm, bruce barker
wrote:
> 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)
>
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.