A
Ajak
Hello,
I am making a user control containing ajax updateprogress control as below:-
<%@ Control Language="vb" AutoEventWireup="false"
CodeBehind="AjaxProgress.ascx.vb"
Inherits="sbmb.AjaxProgress" %>
<span id="spanTag" runat="server" class="ajaxprogress">
<asp:UpdateProgress ID="UpdateProgress1" runat="server">
<ProgressTemplate>
<asp:Image ID="imgLoading" ImageAlign="AbsMiddle"
ImageUrl="~/imej/loading.gif" runat="server" />
<asp:Label ID="lblMessage" runat="server" />
</ProgressTemplate>
</asp:UpdateProgress>
</span>
The purpose is just to wrap updateprogress with span and assign cssclass
"ajaxprogress" to force it to be positioned inline.
In codebehind, I write a property LoadingMessage to set the text of
lblMessage like this:-
Method 1:
CType(UpdateProgress1.Controls.FindControl("lblMessage"), Label).Text =
value
Method 2:
Viewstate("msg") = value
then in UpdateProgress1_Load event, I put
CType(UpdateProgress1.Controls.FindControl("lblMessage"), Label).Text =
Viewstate("msg")
But both methods are not working! FindControl can't find lblMessage and
return nothing!
Therefore, does anyone know how to access the label lblMessage in
ProgressTemplate of UpdateProgress?
I am making a user control containing ajax updateprogress control as below:-
<%@ Control Language="vb" AutoEventWireup="false"
CodeBehind="AjaxProgress.ascx.vb"
Inherits="sbmb.AjaxProgress" %>
<span id="spanTag" runat="server" class="ajaxprogress">
<asp:UpdateProgress ID="UpdateProgress1" runat="server">
<ProgressTemplate>
<asp:Image ID="imgLoading" ImageAlign="AbsMiddle"
ImageUrl="~/imej/loading.gif" runat="server" />
<asp:Label ID="lblMessage" runat="server" />
</ProgressTemplate>
</asp:UpdateProgress>
</span>
The purpose is just to wrap updateprogress with span and assign cssclass
"ajaxprogress" to force it to be positioned inline.
In codebehind, I write a property LoadingMessage to set the text of
lblMessage like this:-
Method 1:
CType(UpdateProgress1.Controls.FindControl("lblMessage"), Label).Text =
value
Method 2:
Viewstate("msg") = value
then in UpdateProgress1_Load event, I put
CType(UpdateProgress1.Controls.FindControl("lblMessage"), Label).Text =
Viewstate("msg")
But both methods are not working! FindControl can't find lblMessage and
return nothing!
Therefore, does anyone know how to access the label lblMessage in
ProgressTemplate of UpdateProgress?