Is there a simple way how to issue ASP.NET AJAX request (from client) for update of update panel without sending the whole page from client to server (probably by manually calling some internal MS javascript initiating async update request)?
Backround:
We have quite simple intranet page that only shows some state (so it doesn't need to maintain view- and control- state). It needs to refresh very frequently (about once a second).
To make things simple I achieved this by Timer and UpdatePanel:
<asp:Timer ID="Timer" runat="server" Interval="1000" />
<asp:UpdatePanel ID="UpdatePanel" runat="server" >
<Triggers>
<asp:AsyncPostBackTrigger ControlID="Timer" EventName="Tick" />
</Triggers>
<ContentTemplate>
<%-- content here --%>
</ContentTemplate>
</asp:UpdatePanel>
This works great, however remote client were updating slower and sometimes got 'clogged' (browser was loading page for long time).
I partially solved this by completely stripping view- and control- state from page (overrided Page class and stopped storing into viewstate element) and mainly by configuring IIS dynamic content compression. This solved majority of issue - as used bandwidth from server to client went rapidly down (and so updates were quicker).
There is still quite considerable traffic from client to server - as basically client sends the page back to server; and also it sends it uncompressed. We do not need to handle any control events or change of state - so we don need the page on server.
Do I have any option how to send just quick AJAX request to server to request UpdatePanel update (probably I need to call some of the MS internal javascript method initiating the async request - I just don't know how to find it and call it).
You could call the __doPostBack function form your javascript with the id of the updatepanel as the 1st argument (the eventtarget). Example:
<div id="somediv" onclick="__doPostBack('<%=UpdatePanel.ClientID%>)', '');">
This should trigger a "partial postback" and should refresh only the updatepanel... Is that what you mean? The second parameter is the eventargument. You can get this serverside like this:
Request.Params.Get("__EVENTARGUMENT");