Showing posts with label next. Show all posts
Showing posts with label next. Show all posts

Saturday, August 02, 2008

"postback" event not related to REVIOUS and NEXT button on Internet Explorer?

in my case PageA has a buttonA that opens PageB. The code is "response.redirect("PageB.aspx");"

on PageB I have some methodM to call under condition "if (!IsPostBack)"

After I clicked on ButtoA to open PageB, methodM is trigerred.

but when I use the PREVIOUS button on Internet Explore to go back to PageA and click on NEXT button to go back to PageB the methodM didn't fire.

How can I catch the Previous and Next button click event?

the answer is adding the code below into Page_Load in the target page, this line of code will force the target page to load from server instead of cache

Response.Cache.SetCacheability(HttpCacheability.NoCache);