to my edit form which is a partialview loaded by my MacroPartialView, then the next time I display the form, the TempData is displayed. It seems the TempData is tied to the view, partial or otherwise, that was visible when the TempData value was set!
How can I get the TempData to display in the MacroPartialView that calls the form partial view?
The problem seems to be related to only being able to access the TempData in the same controller context that set the TempData value:
TempData is a dictionary of string and object. When the PossiblyLoadTempData is called, the TempDataDictionary uses the ControllerContext as well as the ITempDataProvider to load the data.
It seems my form action is being treated as a child action to the main MacroPartialView and there for out of context.
TempData empty after return RedirectToUmbracoPage
If I set TempData before returning a partial view, I can display the contents of TempData on the partial view so I know it kinda works.
But, I am following the online tutorial and setting a value for TempData
before doing
I have
in my MacroPartialView but nothing is apparently in TempData when the page displays.
UPDATE: Turns out the TempData is not actually empty when the page loads. I just cannot get it to display on my parent PartialView. If I add
to my edit form which is a partialview loaded by my MacroPartialView, then the next time I display the form, the TempData is displayed. It seems the TempData is tied to the view, partial or otherwise, that was visible when the TempData value was set!
How can I get the TempData to display in the MacroPartialView that calls the form partial view?
A button click injects the edit form in that last div.
Connie,
What version of Umbraco are you using?
6.1.6
The problem seems to be related to only being able to access the TempData in the same controller context that set the TempData value:
It seems my form action is being treated as a child action to the main MacroPartialView and there for out of context.
The Umbraco documentation at https://our.umbraco.org/documentation/Reference/Mvc/forms/turorial-child-action refers to accessing ViewData of the child in the parent. There must be some similar method to access the child TempData from the parent view.
is working on a reply...