Im new to MVC.. and started to grasp it. I am wondering whether there's a shorter way to pass parameters from view to mvc controller. I am creating a search box with possible conditions.
here's the sample code in the view
@using (Html.BeginForm("Action", "Controller", FormMethod.Get))
{
<p>
Find by fname: @Html.TextBox("fname", ViewBag.CurrentFilter as string)
<br/>
Find by lname: @Html.TextBox("lname", ViewBag.CurrentFilter as string)
<br/>
By Area Code : @Html.TextBox("AreaCode")
<br/>
@Html.DropDownList("StateCD", new SelectList(ViewBag.State))
<br/>
<input id="Button1" type="submit" value="Search"/>
</p>
}
in my controller
public async Task<ActionResult> Action(string id, string sortorder, string statecd,int? page,string country,string areacode,string city,string zip,string z)
{
}
is there a way to shorten that parameter like as an object or concatenated values?