ViewからMy Controllerにモデルを渡す方法は?Asp.netでパーシャルビューにモデルを渡すには?
私は、私の見解で私が部分的に持っている:私のコントローラで
<div class="parking-status">
@Html.Partial("_Restaurants", Model)
</div>
@section Scripts
<script type="text/javascript">
setInterval(function() {
$('.parking-status').hide().load('/Home/Refresh').fadeIn('slow');
}, 3000);
</script>`
:
public ActionResult Refresh(RestaurantListViewModel model)
{
...some operations on model...
return PartialView("~/Views/Home/_Restaurants.cshtml", model);
}
は、どのように私はビューからのActionResultにモデルを渡す必要がありますか?私は試しました:
setInterval(function() {
$('.parking-status').hide().load('/Home/Refresh', { model :'@Model'}).fadeIn('slow');
}, 3000);
ただし、nullはRefresh()メソッドに渡されました。