0
我有,我想提交到一個動作,使這是一個Html.BeginForm()是一個強類型的Html.Telerik()。DatePicker()可能在ASP.NET MVC中的Html.BeginForm()?
我想也利用Html.Telerik的內部設置一個視圖的部分() .DatePicker()控制並希望它也能強制類型鏈接內部表單,與相同DropDownListFor,這是可能的?
<% 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" />
<% } %>
用於查看模型具有適當的性能:
public int SelectedItem { get; set; }
public string SelectedDate { get; set; }
控制器代碼:
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
}
}
感謝您捕捉我錯誤匹配的參數命名:) – 2010-07-20 22:38:21