I am using the Html.BeginForm and passing in a css class as per below:
@using (Html.BeginForm("Logon", "Account", FormMethod.Post, new { @class = "form" } ))
that works fine, but I want to add a returnURL querystring parameter after it but that doesn't seem to work:
@using (Html.BeginForm("Logon", "Account", FormMethod.Post, new { @class = "form", returnUrl = Request.QueryString["ReturnUrl"] }))
how can I add multiple htmlAttributes so that I can tell it my css class and a querystring parameter?
Use the following overload of BeginForm
.
@using (Html.BeginForm("Logon", "Account",
new { returnUrl = Request.QueryString["ReturnUrl"] }, FormMethod.Post,
new { @class = "form"}))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With