Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / December 2007

Tip: Looking for answers? Try searching our database.

Prevent ASP.NET page to resend data on refresh?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Asaf - 12 Dec 2007 12:44 GMT
Hi,

How can I prevent from an ASP.NET page to resend all the data again when the
user press the Refresh button or F5 on the browser?

Thanks in advanced,
Asaf
Peter Bromberg [C# MVP] - 12 Dec 2007 12:50 GMT
One easy way to handle this is to set a Session variable the first time the
page is posted. You can check for the presence of this on any refresh and
abort resending.
-- Peter
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
MetaFinder: http://www.blogmetafinder.com 

> Hi,
>
[quoted text clipped - 3 lines]
> Thanks in advanced,
> Asaf
Asaf - 12 Dec 2007 16:31 GMT
Hi Peter,

I misunderstood your solution, will be much appreciated if you can post an
example.

Asaf

> One easy way to handle this is to set a Session variable the first time the
> page is posted. You can check for the presence of this on any refresh and
[quoted text clipped - 11 lines]
> > Thanks in advanced,
> > Asaf
Steven Cheng[MSFT] - 13 Dec 2007 02:57 GMT
Hi Asaf,

For prevent duplicate form submitting, there does exists some session flag
based approach, here are some web thread discussing on this:

#Preventing Duplicate Record Insertion on Page Refresh
http://aspalliance.com/687

#Prevent Duplicate Form Posting
http://forums.asp.net/p/447620/471229.aspx#471229

http://forums.asp.net/p/1190997/2045619.aspx

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
>From: =?Utf-8?B?QXNhZg==?= <AG70@newsgroups.nospam>
>References:  <AAF68CC1-A3F1-4C67-BECB-6EF11A48681C@microsoft.com>
<D0F0C4F4-C693-42E6-AA2C-607E102464D2@microsoft.com>
>Subject: RE: Prevent ASP.NET page to resend data on refresh?
>Date: Wed, 12 Dec 2007 08:31:03 -0800
[quoted text clipped - 21 lines]
>> > Thanks in advanced,
>> > Asaf
Larry Bud - 12 Dec 2007 13:25 GMT
> Hi,
>
> How can I prevent from an ASP.NET page to resend all the data again when the
> user press the Refresh button or F5 on the browser?

Do a response.redirect after your data is handled to the same page.

For example, if you're letting the databind do all the work, do a
response.direct on a datasource inserted (or updated) event.

If you're handling the data manipulation in code, do it after you do
all your work.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.