I know I can use Html.BeginForm to POST with action parameters like this:
@using (Html.BeginForm("Details", "Home", new { name = Model.Name }))
and I can GET like this:
@using (Html.BeginForm("Details", "Home", FormMethod.Get))
But I can't seem to do both. How do I?
Update
Here is the entirety of the form in question:
@using (Html.BeginForm("Details", "Home", new { name = Model.Name }))
{
<div style="text-align: center">
@Html.DropDownList("viewMonth",
new List<SelectListItem>(ViewBag.MonthNames))
@Html.TextBox("viewYear", Model.ViewYear, new {style = "width: 30px"})
<input type="submit" value="Go"/>
<br/>
<br/>
</div>
}
where viewMonth and viewYear are parameter names in Action/Details. If I try
@using (Html.BeginForm("Details", "Home", new { name = Model.Name },
FormMethod.Get))
it will pass viewMonth and viewYear, but not name.