I have a section of a view that I would like to submit to an action so it is setup inside a Html.BeginForm()
I am trying to also make use of the Html.Telerik().DatePicker() control and would like it also to strongly type linked inside the form, same as the DropDownListFor, is this possible?
<% using (Html.BeginForm("MyAction", "Responding")) { %>
<%= Html.DropDownListFor(m => m.SelectedItem, Model.MyItems) %>
<!--list works fine-->
<% Html.Telerik().DatePicker()
.Name("datePicker")
.Render(); %>
<!--how do I get this strongly-type-linked?-->
<input type="submit" value="submit" />
<% } %>
The model for the view has the appropriate properties:
public int SelectedItem { get; set; }
public string SelectedDate { get; set; }
Controller code:
public class RespondingController : Controller
{
[HttpGet]
public ActionResult MyAction(int SelectedItem, string SelectedDate)
{
//on the form submit SelectedItem value arrives
//need SelectedDate to do the same
}
}