0

我需要从另一个局部视图刷新在主视图中定义的局部视图。那可能吗。

----MainView.cshtml
{
<div id=1>
   @Html.Partial("partial1", Model)
</div>
<div id=2>
   @Html.Partial("partial2", Model)
</div>
}


---Partial1.cshtml
{
when i click a button, i want to refreh div#2
}
4

1 回答 1

0

You can use jQuery to refresh the div2 on click.

1) You can bind the click event and perform some action.

e.g. $("#button1").click(function(){

/// Code to refresh div 2

} )

2) You can raise an event and to the work in registered event.

于 2013-07-23T05:29:51.460 回答