1
嗨我想刷新多個參數的局部視圖。我已經得到它與一個參數一起工作。我怎樣才能讓它使用多個參數。這是代碼,我到目前爲止。 VIEW刷新多個參數的局部視圖
@{
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();
}
有什麼建議嗎?
** [Check here](http://stackoverflow.com/a/16245682/2007801)** – 2013-05-08 12:08:29