maintainscrollposition not maintaining scroll position

hi all, i've got an intranet page displaying sortable gridview that is being refreshed every 10 minutes.  i've added maintainscrollposition header, but when page refreshes, not only does the user get sent back to top of page, they also lose their sort selection.

sort is being done in gridview using session state variable.  page is posted when user selects a value from atuopostback drop down list (day/week/month/year).  strange thing is when the user sorts by column b, then selects different time value from day/week/month/year, the sort is maintained upon the page refresh.  but when the page refreshes from the http meta count, i lose the sort and page position.

how do i maintain page position and sort when using the refresh method below???

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" EnableViewState="false" MaintainScrollPositionOnPostback="true" %>

<head id="Head1" runat="server">
    <title>Realtime Sales</title>
    <meta http-equiv="pragma" content="no-cache" />
    <meta http-equiv="expires" content="-1" />
    <meta http-equiv="refresh" content="15" />

protected void Page_Load(object sender, EventArgs e)
        if (!Page.IsPostBack)
            if (Session["TimeFrameIndex"] != null)
                TimeFrame.SelectedIndex = (int)Session["TimeFrameIndex"];
                TimeFrame_SelectedIndexChanged((object)Session["sender"], (EventArgs)Session["e"]);
            Session["COLUMN_SORT_NAME"] = "APP PREMIUM";
            Session["COLUMN_SORT_ORDER"] = "DESC";

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

when a page is refreshed using the meta tag .. it is not submitting the page .. but just refreshing .. so for the server the page is been requested for the first time .. thats the reason why it does not maintain the scroll or the sort position ..

u could give this a try ...

instead of meta refresh u could use "settimeout" to call a function which will submit the page every 10 minutes ..

window.setTimeout("MyFunction", 600);

function MyFunction
aaalifeAuthor Commented:
that's worse.  upon refresh i get a pop up window saying "page cannot be refreshed without resending information - click retry to send info again, or cancel", then i lose sort and position.

refresh will popup that message if previous action to that page was a "postback" ... its the behaviour of the browser ...

>> then i lose sort and position
even when u click on "retry"?

aaalifeAuthor Commented:
when i click refresh in browser, scroll position and sort are maintained, this is after clicking ok on retry? box.  i need to know how to maintain scroll/position upon the 10 minute page refresh.
>>i need to know how to maintain scroll/position upon the 10 minute page refresh
am not sure thats possible using meta refresh .. when u click on "retry" after u "refresh" the page, u r actually submitting the page again using the same parameters as ur previous refresh .. that the reason y it maintains the sort and scroll position .,.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.