Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > General .NET
|
General .NET For general discussion of MICROSOFT .NET topics that don't fall within any of the other .NET forum subcategories or .NET language forums.  If your question is specific to a language (C# or Visual Basic) or type of application (Windows Forms or ASP.Net) try an applicable forum category. ** PLEASE BE SPECIFIC WITH YOUR QUESTION ** When posting here, provide details regarding the Microsoft .NET language you are using and/or what type of application (Windows/Web Forms, etc) you are working in, if applicable to the question. This will help others answer the question without having to ask.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the General .NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 24th, 2004, 06:03 PM
Authorized User
 
Join Date: Jan 2004
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to rathbird
Default Preventing form submission on refresh

I have a master schedule page that shows if Patients have arrived, paid, cancelled, etc. On this page, I have a control that allows staff to schedule appointments. All appointments have a link to a popup that allows staff to modify appt details. When these details have been modified, I close the popup window and refresh the master schedule so the changes are reflected. The problem is when staff enters an appt, clicks on an appt to modify details, and then closes the popup, it tries to reschedule the appt when refreshing the main page. Is there a way, after I schedule an appt, to clear the response object so a refresh will no longer submit the form?

 
Old February 25th, 2004, 01:23 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

The response object context is only around for the lifespan of one page hit so you shouldn't need to clear it because it starts out clear every time.

When a new appointment is scheduled, is something getting writting to data such that you could get a fresh (not posted back) version of the page? It sounds like the problem is that the popup is refreshing the page that was posted and resulting in another "add new appointment" event firing because of the re-post.

What about if the "add new appointment" event handler does what it needs to add the new appointment, then Response.Redirects to itself so the next view of the page is a clean GET instead of the "new appointment" event POST. This may not work depending on what is happening when you handle the "create new appointment" event.

Peter
------------------------------------------------------
Work smarter, not harder.
 
Old February 25th, 2004, 06:33 PM
Authorized User
 
Join Date: Jan 2004
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to rathbird
Default

This worked wonderfully! Should have been an obvious solution. Thanks a bunch.






Similar Threads
Thread Thread Starter Forum Replies Last Post
Preventing page refresh from asp.net button hericles ASP.NET 1.0 and 1.1 Professional 2 October 8th, 2008 04:29 PM
form submission...help!? mdbrueckner ASP.NET 2.0 Basics 1 September 19th, 2007 06:16 PM
Preventing user from closing form lizhaskin Access 3 December 21st, 2005 01:01 PM
Simple Form Submission Maxood Beginning PHP 3 July 17th, 2004 06:03 AM
Preventing Windows Form Automatic Refresh? Ron Howerton VB.NET 2002/2003 Basics 9 June 17th, 2004 08:48 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.