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

Popular posts from this blog

java - Oracle EBS .ClassNotFoundException: oracle.apps.fnd.formsClient.FormsLauncher.class ERROR -

c# - how to use buttonedit in devexpress gridcontrol -

nvd3.js - angularjs-nvd3-directives setting color in legend as well as in chart elements -