This is a migrated thread and some comments may be shown as answers.

Session kept alive with a grid "auto" refresh

1 Answer 158 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Doug Swanson
Top achievements
Rank 1
Doug Swanson asked on 13 Sep 2011, 06:07 PM
Hi,
  I have a asp.net page that has a grid on it.  This grid is refreshed peridodically via a RadXMLHttpPanel.  The problem is that I need this auto refresh to stop when session state ends and redirect to a login page...however the auto refresh mechanism keeps the session state alive.  I thought the Ajax controls bypassed part of page life cycle and session state would expire...but it appears to be doing a full postback?  How can I get a partial page update without keeping session state alive?...and ultimately once session state is dead then to redirect to another page...Below is my script code that starts the refresh based on a js timer...

//js script
function startWorklistRefresh() {
                if (wlIntervalId == 0) {
                    wlIntervalId = setInterval("reloadWorklist();", wlCtrlAutoRefreshRate);
                }
               }
 
            function reloadWorklist() {
                $find("<%= XmlGridPanel.ClientID %>").set_value("Reload");
            }
 
            function GridXmlPanel_OnResponseEnded(sender, args) {
                startWorklistRefresh();
            }
 
//aspnet markup...
 <telerik:RadXmlHttpPanel ID="XmlGridPanel" runat="server" OnServiceRequest="GridXmlPanel_OnServiceRequest"
            OnClientResponseEnded="GridXmlPanel_OnResponseEnded" EnableClientScriptEvaluation="true">
            <telerik:RadGrid id="GridWorklist" runat="server" SkinID="main" GridLines="None" style="outline: none;" OnItemCreated="GridWorklist_ItemCreated" OnItemDataBound="GridWorklistt_ItemDataBound">...
 
And the xml panel event on the server side...
 protected void GridXmlPanel_OnServiceRequest(object sender, RadXmlHttpPanelEventArgs e)
        {
            GridWorklist.DataSource = RadTechData.GetWorklist(AppUtils.CurrentFacilityID);
            GridWorklist.DataBind();
        }

1 Answer, 1 is accepted

Sort by
0
Pero
Telerik team
answered on 15 Sep 2011, 05:04 PM
Hi Doug,

The RadXmlHttpPanel control is build on top of the ASP.NET and uses ASP.NET callbacks to update its content. This means there is not much we can do to work around the Session state being kept alive. I searched the internet, but didn't find any solutions as to how the to not renew the Session during ASP.NET callbacks.

Maybe binding the RadGrid on the client will help you avoid this issue, because it retrieves its data from a WebService. Here is an example of Grid with client-side binding: http://demos.telerik.com/aspnet-ajax/grid/examples/clientbinding/defaultcs.aspx.

All the best,
Pero
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal
Tags
Ajax
Asked by
Doug Swanson
Top achievements
Rank 1
Answers by
Pero
Telerik team
Share this question
or