I am a bit confused with the Html helpers in MVC3.
I used this syntax when creating my forms before:
@using (Html.BeginForm("action", "controller", FormMethod.Post, new { @class = "auth-form" })) { ... }
it gives me
<form action="/controller/action" class="auth-form" method="post">...</form>
excellent, then what I need then.
Now I need to pass the ReturnUrl parameter to the form, so I can do it like this:
@using (Html.BeginForm("action", "controller", new { ReturnUrl="myurl" } )) { ... }
which would give me
<form action="/controller/action?ReturnUrl=myurl" method="post"></form>
but I still need to pass the css class and id to this form, and I cannot find a way to do this while passing the ReturnUrl parameter.
If I add FormMethod.Post
, it will add all my parameters as attributes to the form tag, without FormMethod.Post
it will add them as query string parameters.
How can I do it?
Thanks.
source share