您好我正在尝试使用多个参数刷新部分视图。我已经让它与一个参数一起工作。我怎样才能让它与多个参数一起工作。这是代码,我到目前为止。看法
@{
ViewBag.Title = "Report";
Layout = "~/Views/Shared/_Layout.cshtml";
}
<script type="text/javascript">
$(document).ready(function () {
$("#serviceLine").change(function () {
var url = "/Home/PartialView1?serviceLine=" + $(this).val();
alert(url);
$("#reportContent").load(url);
});
$("#ClientID").change(function(){
var url = "/Home/PartialView1?ClientID=" + $(this).val();
alert(url);
$("#reportContent").load(url);
});
});
</script>
<h3>Report</h3>
<div>
<table>
<tr>
<td>Client</td>
<td>@Html.DropDownList("ClientList", null, new {id = "ClientID"})</td>
<td>ServiceLine</td>
<td>@Html.DropDownList("ServiceLine", null, new {id="serviceLine"}) </td>
</td>
</tr>
</table>
</div>
<div>
<h2>List</h2>
<div id="reportContent">
@Html.Action("PartialView1", new { clientID = 0, serviceLine = "_" })
</div>
</div>
控制器
public ActionResult PartialView1(int clientID, char serviceLine)
{
//Login
return PartialView();
}
有什么建议吗?