J
Jeff
hi
asp.net 3.5
I'm wondering if UpdatePanel can work inside a GridView. So I created a
simple test page (below you see a part of the markup of my test page.)...
This GridView contains 2 rows. When I tested this page. Only the content in
the UpdatePanel of last row gets updated.
So I wonder what I do wrong as only the last row get updated... And also I
would like the each UpdatePanel on each row to retrieve data specific for
that row. So I'm not sure how to do that.. I mean what events should I look
into?
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
<asp:Timer ID="Timer1" runat="server" OnTick="Timer1_Tick"
Interval="10000"></asp:Timer>
<asp:GridView ID="gvTest"
DataSourceID="SqlDataSource1"
runat="server" AutoGenerateColumns="false"
OnRowDataBound="gvTest_RowDataBound">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<table>
<tr>
<td>
<asp:Literal ID="Literal1"
runat="server"></asp:Literal>
</td>
</tr>
<tr>
<td>
<asp:UpdatePanel ID="UpdatePanel1"
runat="server">
<Triggers>
<asp:AsyncPostBackTrigger
ControlID="Timer1" EventName="Tick" />
</Triggers>
<ContentTemplate>
<asp:Label ID="Label3" Text="Panel
created" runat="server"></asp:Label>
</ContentTemplate>
</asp:UpdatePanel>
</td>
</tr>
</table>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
protected void Timer1_Tick(object sender, EventArgs e)
{
Label3.Text = "Refreshed at " + DateTime.Now.ToString();
}
asp.net 3.5
I'm wondering if UpdatePanel can work inside a GridView. So I created a
simple test page (below you see a part of the markup of my test page.)...
This GridView contains 2 rows. When I tested this page. Only the content in
the UpdatePanel of last row gets updated.
So I wonder what I do wrong as only the last row get updated... And also I
would like the each UpdatePanel on each row to retrieve data specific for
that row. So I'm not sure how to do that.. I mean what events should I look
into?
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
<asp:Timer ID="Timer1" runat="server" OnTick="Timer1_Tick"
Interval="10000"></asp:Timer>
<asp:GridView ID="gvTest"
DataSourceID="SqlDataSource1"
runat="server" AutoGenerateColumns="false"
OnRowDataBound="gvTest_RowDataBound">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<table>
<tr>
<td>
<asp:Literal ID="Literal1"
runat="server"></asp:Literal>
</td>
</tr>
<tr>
<td>
<asp:UpdatePanel ID="UpdatePanel1"
runat="server">
<Triggers>
<asp:AsyncPostBackTrigger
ControlID="Timer1" EventName="Tick" />
</Triggers>
<ContentTemplate>
<asp:Label ID="Label3" Text="Panel
created" runat="server"></asp:Label>
</ContentTemplate>
</asp:UpdatePanel>
</td>
</tr>
</table>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
protected void Timer1_Tick(object sender, EventArgs e)
{
Label3.Text = "Refreshed at " + DateTime.Now.ToString();
}