Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
BOOK: Professional ASP.NET MVC 3
This is the forum to discuss the Wrox book Professional ASP.NET MVC 3 by Jon Galloway, Phil Haack, Brad Wilson, K. Scott Allen; ISBN: 978-1-1180-7658-3
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional ASP.NET MVC 3 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
  #1 (permalink)  
Old September 22nd, 2011, 08:15 AM
Authorized User
Points: 106, Level: 2
Points: 106, Level: 2 Points: 106, Level: 2 Points: 106, Level: 2
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Sep 2009
Posts: 24
Thanks: 3
Thanked 0 Times in 0 Posts
Default Return View

Hi
I have return View("urlofnextpage",dmodel) on a httppost method of page.
Now i get redirected on next view ,but when refresh the page action again get performed.

i can use redirecttoaction,but i ned to use model,which can not be passed from here.
Another thing i dont want to change my url on browser,please suggest solution.
  #2 (permalink)  
Old September 27th, 2011, 12:27 PM
Wrox Author
Points: 15, Level: 1
Points: 15, Level: 1 Points: 15, Level: 1 Points: 15, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2011
Posts: 5
Thanks: 0
Thanked 1 Time in 1 Post
Default

Unfortunately, those are the mechanics of HTTP. If you render something in response to a POST, then the user is free to POST it again.

The only two ways to work around this are:

- The result of the post should be a redirect, which will then cause the browser to issue a GET request.
- Don't have the original request be a POST, but instead be a GET (perhaps using Ajax).

To do the former, and still keep access to model information, you can use TempData (which survives a redirect).


Similar Threads
Thread Thread Starter Forum Replies Last Post
Design view or source view tab doesnt appear Muddasar BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 2 March 25th, 2009 04:16 AM
Design view or source view tab doesnt appear Muddasar BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 0 March 24th, 2009 08:18 PM
Urgent - Send mail with plain view and html view ashish.dadhwal ASP.NET 2.0 Professional 0 November 27th, 2008 01:49 AM
Help Grid View Drop Down List, view all jskinner123 ASP.NET 2.0 Basics 0 November 25th, 2007 06:25 PM
populate details view or list view non empty rows iinfoque ASP.NET 2.0 Basics 0 March 11th, 2007 06:11 AM





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