ASP.net
Awesome
Learn
Forum
Buy
Demos
Sign In
☾
☀
Switch to
Dark
Light
Mode
this site works best with javascript enabled
Ask Question
Adapting RenderView Method from Controller Extensions to support razor partial views
Title:
B
I
{code}
?
Hello everyone, I have the following attempted use of an AjaxList Helper @Html.Awe().AjaxList("announcements").Url(Url.Action("Search","AnnouncementAjaxList")).Parent("txtSearch", "search") With action method like so public ActionResult Search(String search, int page, int? pageSize) { ... return Json(new AjaxListResult() { Content = this.RenderView("ListTemplates/Announcement", list.Page(page, pageSize.Value).ToList()), More = list.Count() > (page*pageSize) }); } and Partial View Code Like So @model System.Collections.Generic.IEnumerable<CellMinistry.CampusMinistry.Models.Domain.AnnouncementListModel> @foreach (var i in Model) { <li data-k="@i.Id" class="awe-li awe-il"> <div> <small>@i.PostedOn.ToShortDateString()</small> <h4>@i.Subject</h4> <p>@i.ShortBody</p> <button type="button" class="btn" onclick=" awe.open('viewDetails', { params: { id: @(i.Id) } }) " style="padding: 0.1em 0.3em"> <i class="fa fa-folder-open "></i> </button> </div> </li> } Everything works fine except that when the AjaxList is rendered, View is rendered as it it where a full view and not as a partial view. (With Navigation and All within the parent view.) Please what am I doing wrong
Save Changes
Cancel
seamfaces
asked at 14 Apr 2015
add @{ Layout = null; } second line after @model
at 14 Apr 2015
Omu
Thanks, It works Perfectly
at 15 Apr 2015
seamfaces
Answers
please
Sign In
to leave an answer
By accessing this site, you agree to store cookies on your device and disclose information in accordance with our
cookie policy
and
privacy policy
.
OK