rizwana ahmed

rizwana ahmed

  • NA
  • 56
  • 1.7k

how to use @html.renderpartial() and return of controller ac

Aug 17 2016 4:34 AM
plz show codes..not running...
@{Html.RenderAction("Archieves", "UserBlog");}

public ActionResult Archieves()
{
try
{
var model = new BlogModel();
var blogRecentList = _apiBlog.GetAllBlogArchieves().ToList();

model.BlogList = blogRecentList.Select(item =>
{
return new BlogModel()
{
Month = item.MonthYear,
};
}).ToList();

model.ArchievesBlogList = model.BlogList.OrderByDescending(x => x.ID).ToList();

return PartialView("_BlogArchieve", model);

}
catch (Exception ex)
{
throw ex;
}
} 

Answers (2)