i have a gridview in updatePanel that i need to update every interval of time
what i have found so far on updating updatepanel is :
<asp:UpdatePanel ID="UpdatePanel2" runat="server" OnLoad="Button1_Click">
<ContentTemplate>
<fieldset>
<legend>UpdatePanel</legend>
<asp:Label ID="Label2" runat="server" Text="Panel created.">
</asp:Label>
<asp:Button ID="Button1" runat="server"
OnClientClick="__doPostBack('UpdatePanel2', '');" Text="Button" />
</fieldset>
</ContentTemplate>
</asp:UpdatePanel>
and this sub
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs)
Label2.Text = "Refreshed at " & _
DateTime.Now.ToString()
End Sub
though this works fine and update the panel but it postback the whole the page , you can tell when you see all the images reloading in another panel , i’m planning to update this panel every second
Question is How can i update UpdatePanel2 without affecting the other panel with the postback
EDIT
Another Question does any thing runs at the server side DO postback ?
Thanks
As of NET 3.5 there is the Web.UI.Timer control:
It is able to work with UpdatePanels, ensures that data (e.g. ViewState and updated control values) is not lost, and is “just another WebForm control”. However, the Timer must still cause a [partial] postback to go through the page life-cycle and rebind the grid again.
Depending on exact use-case, it may be better to use a true AJAX-approach to minimize the page life-cycle and data size overhead. (Telerik, DevExpress, and other 3rd-party libraries support “lightweight callbacks” for their Grid controls. Even more lightweight variants might include jqGrid.)