Q: back and a button click does not fire page_load

Discussion in 'ASP .Net' started by =?Utf-8?B?SklNLkgu?=, Apr 6, 2005.

  1. Hello,
    I have two apsx pages, and I set a session variable in asp1 and click to a
    button to go to aspx2. In aspx2, I use this session variable in the query and
    show data on the datagrid. I do this in the page) load without any post back
    check. My problem is: each time I click button and go to aspx2, it is always
    previous data shown in the data grid (as if cash is brought and query is not
    performed), when I click refresh in the internet explorer, right data is
    shown. It seems to me page_load is aspx2 is not launched again if I click
    back in IE and click my button again to come back to aspx2. What is
    problem/solution?
    Thanks,
    Jim.
     
    =?Utf-8?B?SklNLkgu?=, Apr 6, 2005
    #1
    1. Advertising

  2. Hi Jim,
    I had seen this this isssue happening on my machine as well during one of
    the project.

    Can you double check the IE properties
    Goto IE options on General tab ,
    Select Temporary internet Files group and click on Settings.. button.
    Settings dialog box will open make sure that, you have selected radio button
    for Check for newer versions of stored pages:
    Every visit to the page.

    For me , after selecting this radio button resolved the issue.

    Harish


    Internet

    "JIM.H." wrote:

    > Hello,
    > I have two apsx pages, and I set a session variable in asp1 and click to a
    > button to go to aspx2. In aspx2, I use this session variable in the query and
    > show data on the datagrid. I do this in the page) load without any post back
    > check. My problem is: each time I click button and go to aspx2, it is always
    > previous data shown in the data grid (as if cash is brought and query is not
    > performed), when I click refresh in the internet explorer, right data is
    > shown. It seems to me page_load is aspx2 is not launched again if I click
    > back in IE and click my button again to come back to aspx2. What is
    > problem/solution?
    > Thanks,
    > Jim.
    >
     
    =?Utf-8?B?SGFyaXNoIFNoaWtoYXJl?=, Apr 6, 2005
    #2
    1. Advertising

  3. Re: back and a button click does not fire page_load

    This will ensure the page doesn't get cached, which seems to be your
    problem.

    Response.Expires = 0
    Response.Cache.SetNoStore()
    Response.AppendHeader("Pragma", "no-cache")

    --
    I hope this helps,
    Steve C. Orr, MCSD, MVP
    http://SteveOrr.net


    "JIM.H." <> wrote in message
    news:...
    > Hello,
    > I have two apsx pages, and I set a session variable in asp1 and click to a
    > button to go to aspx2. In aspx2, I use this session variable in the query
    > and
    > show data on the datagrid. I do this in the page) load without any post
    > back
    > check. My problem is: each time I click button and go to aspx2, it is
    > always
    > previous data shown in the data grid (as if cash is brought and query is
    > not
    > performed), when I click refresh in the internet explorer, right data is
    > shown. It seems to me page_load is aspx2 is not launched again if I click
    > back in IE and click my button again to come back to aspx2. What is
    > problem/solution?
    > Thanks,
    > Jim.
    >
     
    Steve C. Orr [MVP, MCSD], Apr 6, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. bminder
    Replies:
    1
    Views:
    2,177
    nfedin
    Feb 23, 2004
  2. Amelyan
    Replies:
    0
    Views:
    739
    Amelyan
    Jun 5, 2005
  3. Amelyan
    Replies:
    4
    Views:
    7,706
    sajidali3387
    Dec 9, 2011
  4. Amy
    Replies:
    0
    Views:
    992
  5. Mark

    Button-click fire before or after page_load?

    Mark, Mar 2, 2004, in forum: ASP .Net Building Controls
    Replies:
    7
    Views:
    211
    Alessandro Zifiglio
    Mar 6, 2004
Loading...

Share This Page