我试图通过一个表格值“客户ID”(iedropdownlist选择的值)在MVC 4.使用Ajax.Actionlink谁能告诉我什么,我做错了什么?
<div class="editor-label">
@Html.LabelFor(model => model.CustomerID, "Customer Name")
</div>
<div class="editor-field">
@Html.DropDownListFor(model => model.CustomerID, Model.CustomersList, "-- Select --")
@Html.ValidationMessageFor(model => model.CustomerID)
</div>
<div id="ApptsForSelectedDate">
@Ajax.ActionLink("Click here to view appointments",
"AppointmentsList",
new {id = Model.CustomerID},
new AjaxOptions
{
UpdateTargetId = "ApptsForSelectedDate",
HttpMethod = "GET",
InsertionMode = InsertionMode.Replace,
LoadingElementId = "progress"
}
)
</div>
<div id="progress">
<img src="../../Images/ajax-loader.gif" alt="loader image" />
</div>
我的控制器方法是这样的:
public PartialViewResult AppointmentsList(int id)
{ ... }