ispost back
1)user comes from page1 to page2
2)on the page2 load i show him a panel1 asking him whehther he wants alert on the category or not.
3)when the user clicks the submit button of panel1, i show him the second panel2 in the same page and show him the back button
now my question is
if instead of clicking back button of panel2 if he refreshes the page the same data of alert is posted again how to avoid
This is a known limitation of ASP.NET. There is no real solution but there have been numerous workarounds posted. The most prevalent is to ensure that your pages detect this situation. One technique that I used for a while was to actually modify the page generation to include a ref count of each page postback. If the ref count did not increment between the last post and this post then the page was refreshed. Otherwise the page was being posted back for real. This worked well because the technique exposed a property to the page to allow the page to know whether this was a refresh or a postback.
The original article was posted in MSDN Magazine quite a # of years ago. I can't find the original article so here is a post to someone who tried to fix a few problems with the original: http://dotnetslackers.com/community/blogs/simoneb/
In general however it is just easier to never design a page that can't handle a postback twice.
Michael Taylor - 6/18/07
http://p3net.mvps.org