How to access the parent of a parent of a partial view's viewmodel?

Go To StackoverFlow.com

0

In asp.net mvc3, if I have a top view:

@model BuilderVM
@using (Ajax.BeginForm("TaskSelector", ajaxOpts))
{
}
<div id="here"></div>

which gets updated with a partial view in the div id="here" returned from the action TaskSelector after a post from the Ajax form (i.e. public action TaskSelector(BuilderVM m){var vm = new SelectorVM();vm.property=m.property;return PartialView(vm);}. Inside that div, this next partial view is genereated:

@model SelectorVM
@using (Ajax.BeginForm("Choices", ajaxOpts))
{
}
<div id="selected"></div>

From that partial view, the next partial view is then updated inside the div id="selected".

@model ChooserVM
@using (Ajax.BeginForm("Ender", ajaxOpts))
{
}
<div id="ended"></div>

How, from the action "Ender"

public ActionResult Ender (ChooserVM vm)
{
 //access BuilderVM.SomeProperty
}

can I access BuilderVM?

2012-04-03 22:08
by Travis J


0

Short answer: you don't. There is no access unless the data is stored in the session.

2012-04-04 22:41
by Travis J
Ads