asp.net mvc - Calling same partial view from multiple parent pages -
i have partial view using in 2 parent pages. want detect parent page calling partial view.
does there event find this?
the partialextensions.partial
helper has extension takes viewdatadictionary partial name, see http://msdn.microsoft.com/en-us/library/ee407439(v=vs.100).aspx. can use pass in whatever want key:value pairs, e.g. parentviewname string. parent views can do
@html.partial("partialname", new viewdatadictionary { {"parentviewname", "parentview1"} })
then in partial can access view data via:
@viewdata["parentviewname"]
Comments
Post a Comment