|
-
May 23rd, 2010, 10:41 AM
#1
Thread Starter
Hyperactive Member
[RESOLVED] Redirect, passing model class
I got a ContactForm view model class (name,email,subject message).
In the contact "get" action method, I create a new instance of this class, and render my view with it.
Now, what I want to do in the contact "post" action method (if modelstate is valid and the message have been sent successfully) is to display a view (strongly typed using the ContactFormViewModel) and simple say "The following message was sent successfully:" and a "DisplayForModel()".
However it seems one cannot do a redirecttoaction (or route) passing a model (which the action method returning the last view will need).
I can return a View, and pass the model, but that break the PRG pattern (F5 submit the message again).
Probably just missing something simple, but figured I'd post.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|