asp.net mvc 4 - how to add a partial view in the layout page in mvc 4 web application -
i new mvc. want add together partial view in layout page. created action method partial view , using action craeted partial view. want add together partial view in other views...how can this
this action partial view
public actionresult _partialindex() { ilist<lawyermodel> lawyerlist = new list<lawyermodel>(); var query = (from lawyer in context.law_advocates orderby lawyer.advocateid ascending select lawyer).take(35); var lawyerimg = query.tolist(); foreach (var lawyerdata in lawyerimg) { lawyerlist.add(new lawyermodel() { advocateid = lawyerdata.advocateid, imageid = lawyerdata.imageid, imagepath = "~/memphoto/" + lawyerdata.imageid }); } homecoming partialview(lawyerlist); }
you can add together partial view in layout page itself.
please add together this
@html.partial(“partialviewname”) // ‘partialviewname’ partial view name
asp.net-mvc-4
No comments:
Post a Comment