I have a controller action in asp.net mvc
application
public ActionResult ForFahrzeug(DateTime? initDate = null, DateTime? finalDate = null, long id = 0, long days = 0, string ExpGnr = "")
{
//body
}
I am calling this above method in a view as below
@using (Html.BeginForm("ForFahrzeug", "Messungen", FormMethod.Get))
{
<P>Fahrten von:
@Html.TextBox("initDate", "", new { style = "width:15%", @class = "datefield" }) bis:
@Html.TextBox("finalDate", "", new { style = "width:15%", @class = "datefield" })
<input type="submit" value="Filter" /> </p>
}
I want to get the value of "ExpGnr" from view. How could I do it? I tried to do it like below but it does not work.
@using (Html.BeginForm("ForFahrzeug", "Messungen", FormMethod.Get, new { ExpGnr = "Smart_ED"}))
{
Fahrten von:
@Html.TextBox("initDate", "", new { style = "width:15%", @class = "datefield" }) bis:
@Html.TextBox("finalDate", "", new { style = "width:15%", @class = "datefield" })
<input type="submit" value="Filter" /> </p>
}