i need to render list data in partial page... I have store procedure that is responsible to get list of menus and have master Layoutpage in view--> shared folder--> now i am rendering partial page in masterLayout page but i am not getting any result. I am aware that partial page doesn't go through controller so how i would pass the data in that?
Controller Action
public ActionResult DisplayFunctionsList()
{
var myList = F_UOF.GetAllFunctions();
return View(myList);
}
Store Procedure Mapping (Model) class
public class GetAllFunction_SP_Map
{
public GetAllFunction_SP_Map() { }
[Key]
public int Hierarchy_ID { get; set; }
[Required]
public int ParentID { get; set; }
[StringLength(250)]
[Required]
public string ParentName { get; set; }
[Required]
public int ChildID { get; set; }
[StringLength(250)]
[Required]
public string ChildName { get; set; }
[StringLength(250)]
[Required]
public string Controller { get; set; }
[StringLength(250)]
[Required]
public string Action { get; set; }
}
MasterLayout Page
@Html.Partial("_DisplayFunctionList_Partial")
Partial Page (_DisplayFunctionList_Partial)
@model IEnumerable<DatabaseLayer.StoreProcedures.StoreProceduresMapping.GetAllFunction_SP_Map>
@foreach(var item in Model)
{
@item.ParentName
}
return PartialView(view_name, model);in your controller action.PartialView()all the time :)