Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Q: back and a button click does not fire page_load

Reply
Thread Tools

Q: back and a button click does not fire page_load

 
 
=?Utf-8?B?SklNLkgu?=
Guest
Posts: n/a
 
      04-06-2005
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.

 
Reply With Quote
 
 
 
 
=?Utf-8?B?SGFyaXNoIFNoaWtoYXJl?=
Guest
Posts: n/a
 
      04-06-2005
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.
>

 
Reply With Quote
 
 
 
 
Steve C. Orr [MVP, MCSD]
Guest
Posts: n/a
 
      04-06-2005
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:8F8E52F7-4B71-4769-9B36-...
> 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.
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I force Page_Load/PostBack on browser's back button click? Amelyan ASP .Net 4 12-09-2011 05:48 AM
How to fire both event button click and textchanged when button is click and text is changed Amy ASP .Net 0 06-01-2006 02:33 PM
Force Page_Load/PostBack on browser's back button click Amelyan ASP .Net 0 06-04-2005 11:11 PM
Button-click fire before or after page_load? Mark ASP .Net Building Controls 7 03-06-2004 10:41 AM
Why does page_load fire twice when inheriting from a common overridable Page_Load bminder ASP .Net 1 02-23-2004 08:54 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57