Best practice for submits redirecting to another page in MVC2?

Posted by blesh on Stack Overflow See other posts from Stack Overflow or by blesh
Published on 2010-04-27T01:04:53Z Indexed on 2010/04/27 1:13 UTC
Read the original article Hit count: 454

I have a situation with my MVC2 app where I have multiple pages that need to submit different information, but all need to end up at the same page. In my old Web Forms app, I'd have just accomplished this in my btnSave_Click delegate with a Redirect.

There are three different types of products, each of which need to be saved to the cart in a completely different manner from their completely different product pages. I'm not going to get into why or how they're different, just suffice to say, they're totally different. After they're saved to the cart, I need to "redirect" to the Checkout view. But it should be noted, that you can also just browse straight to the Checkout view without having to submit any products to add to the cart.

Here's a diagram of what I'm trying to accomplish, and how I think I need to handle it: alt text

Is this correct? It seems like a common scenario, but I haven't seen any examples of how I should handle this.

Thank you all in advance.

© Stack Overflow or respective owner

Related posts about asp.net-mvc-2

Related posts about best-practices