我有一个视图,我在其中加载了一个部分视图,我想刷新视图上的一个 div 而不加载整个视图。我的代码:
<div id="newrealeaseform">
<div id="newrealeaseformplayer">
@* @Html.Action("MusicPlayer", "NewRelease")*@
</div>
`@Html.Partial("_MusicPlayer")`
`@using (Ajax.BeginForm("Index", new AjaxOptions { `
`hereHttpMethod="GET",`
` InsertionMode = InsertionMode.Replace,
UpdateTargetId = "albumlist"
}))
{
<div id="newrealeaseformcontent">
<h2>New Releases(@Model.Genre)</h2>
<div id="daterangesearchcntrl">
@Html.HiddenFor(m => m.Genre)
@Html.Label("choose release date")
@Html.TextBoxFor(m => m.DateRange, new { @readonly = "readonly", @id = "daterange" })
<input class="sb_search" type="submit" value=""/>
</div>
<br />
<br />
<br />
<div id="albumlist">
<ul id="newreleasealbum-list">
@foreach (var album in Model.Albums)
{
<li style="margin-left:0px;padding-left:0px">
<a href="@Url.Action("AlbumPopup", new { id = album.AlbumId })" class="openPlayer">
<img alt="@album.Title" width="75" height="74" src="@album.AlbumPhoto.ThumbnailPath" />
<div class="clear"></div>
</a>
</li>
}
</ul>
<div class="clear"></div>
</div>
</div>
}
</div> `
我想刷新“专辑列表”div,而不在此视图上重新加载 Html.Partial("_MusicPlayer")。请帮忙。
提前致谢