multiple partial views mvc 2
Posted
by nik1
on Stack Overflow
See other posts from Stack Overflow
or by nik1
Published on 2010-05-09T15:08:07Z
Indexed on
2010/05/09
15:18 UTC
Read the original article
Hit count: 394
asp.net-mvc-2
|partial-views
Hello World!
Hi guys, I have a master page with two partial viewson it both of which submit to the AccountController. When I click Submit on either of the partial views the following happens:
If I declare the partial views like Html.BeginForm("PartialAction1","Account") it redirects to that partial view on clicking submit instead bringing back the default HomeContoller Index view with validation errors.
If I declare the partial view forms as Html.BeginForm() then it returns to the default index view of the home controller. But it actually fires both partial view actions inside the AccountController and thus returns validation errors for both partial views simultaneously.
What I want is version 2 above with only one action firing instead of two. Am I missing, hopefully, something very simple? I hoping someone can help me or point me in the right direction.
Here's the code from my master page for the partial views Html.Action("Login1","Account") Html.Action("Login2", "Account")
Many Thanks!
© Stack Overflow or respective owner