我正在尝试使用 MVC 4 中的 Ajax.Actionlink 传递表单值“CustomerID”(iedropdownlist 选定值)。有人可以告诉我我在这里做错了什么吗?
<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)
{ ... }