Posted
on Mar 28, 2012
(permalink)
I am creating a form for our volunteers to keep track of the time they give to different events. The "TimeCard" model is a VolunteerId, EventId, FromDateTime, ToDateTime.
The view is strongly typed to a TimeCard, along with a ViewBag.EventLookup.
Here is my DropDownList of Events:
@Html.Telerik().DropDownList()
.Name("EventId)
.BindTo(new SelectList(ViewBag.EventLookup,"Value", "Text"))
)
The FromDateTime and ToDateTime are @Html.EditorFor(model => model.FromDateTime) and @Html.EditorFor(model => model.ToDateTime), respectively. I set them to DateTime.Now in the controller by default.
My EditorFor uses <%= Html.Telerik().DateTimePicker(m => m)%>
I want to update the FromDateTime and ToDateTime fields after the correct DropDownList Event has been selected.
Thanks,
Jamie