J
John Kotuby
Hi guys,
I am using 3rd-party grids in Callback mode. When something in a grid is
changed and saved by the user, the grid performs a callback to run the
server code to save the changes and then refresh the grid/s. That's all
working fine.
However, I have placed a Label control and a table cell inside of an update
panel with UpdateMode set to "Always". I want the Label control to display
an appropriate messsage text according to the current state of the Grids.
Running in debug mode I see that the code that I have placed in
Page_PreRender actually seems to run properly during a Callback from the
grids. However the CallBack is not a postback. Fortunately I rebuild the
Grids data whether a Postback or Not. How can I update the Label dusing a
callback? Can I return the Text I want somehow and then apply it on the
Client side?
Thanks for any help. The code is below.
<asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Always" >
<ContentTemplate>
<table id="Table1" style="position: relative" border="0" width="370px"
cellspacing="0" cellpadding="0">
<tr>
<td valign="top" align="center" colspan="2" style="padding: 4px">
<asp:Label ID="lblFeedback" runat="server" CssClass="title14"
ForeColor="#990000" EnableViewState="false"
Text="Select a Category to Work With" />
</td>
</tr>
<tr style="height: 5px">
<td runat="server" id="tdMyErrMsg" colspan="2" align="center" style="color:
red">
</td>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>
Protected Sub Page_PreRender(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.PreRender
If Page.IsPostBack Then
buildGrid1()
buildGridCats()
End If
If Grid1.Items.Count = 0 And strCodeId = "" Then
Me.lblFeedback.Text = "There are No 'Custom Category Groups'. Please Add
One or More"
ElseIf GridCats.Items.Count = 0 And strCodeId = "" Then
Me.lblFeedback.Text = "There are No 'Custom Categories'. Please Add Some
to Work With"
ElseIf strCodeId = "" Then
Me.lblFeedback.Text = "Select a Custom Category to Work With
(Double-Click)"
End If
End Sub
I am using 3rd-party grids in Callback mode. When something in a grid is
changed and saved by the user, the grid performs a callback to run the
server code to save the changes and then refresh the grid/s. That's all
working fine.
However, I have placed a Label control and a table cell inside of an update
panel with UpdateMode set to "Always". I want the Label control to display
an appropriate messsage text according to the current state of the Grids.
Running in debug mode I see that the code that I have placed in
Page_PreRender actually seems to run properly during a Callback from the
grids. However the CallBack is not a postback. Fortunately I rebuild the
Grids data whether a Postback or Not. How can I update the Label dusing a
callback? Can I return the Text I want somehow and then apply it on the
Client side?
Thanks for any help. The code is below.
<asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Always" >
<ContentTemplate>
<table id="Table1" style="position: relative" border="0" width="370px"
cellspacing="0" cellpadding="0">
<tr>
<td valign="top" align="center" colspan="2" style="padding: 4px">
<asp:Label ID="lblFeedback" runat="server" CssClass="title14"
ForeColor="#990000" EnableViewState="false"
Text="Select a Category to Work With" />
</td>
</tr>
<tr style="height: 5px">
<td runat="server" id="tdMyErrMsg" colspan="2" align="center" style="color:
red">
</td>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>
Protected Sub Page_PreRender(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.PreRender
If Page.IsPostBack Then
buildGrid1()
buildGridCats()
End If
If Grid1.Items.Count = 0 And strCodeId = "" Then
Me.lblFeedback.Text = "There are No 'Custom Category Groups'. Please Add
One or More"
ElseIf GridCats.Items.Count = 0 And strCodeId = "" Then
Me.lblFeedback.Text = "There are No 'Custom Categories'. Please Add Some
to Work With"
ElseIf strCodeId = "" Then
Me.lblFeedback.Text = "Select a Custom Category to Work With
(Double-Click)"
End If
End Sub