I made a MacroPartial which contains a simple form and i used it in RTE. it posts on surfacecontroller and I am trying to set viewdata on error but its empty.
I tried to show viewdata with both ways @ViewData["error"] and because it is a macro i tried this one @ViewContext.ParentActionViewContext.ParentActionViewContext.ViewData["error"].
No luck! can someone help me?
Note: if i use the same form without macropartial then it works fine and i got viewdata
ViewData is not available in MVC Partial Macro
Hi,
I have a simple case and i got stuck.
I made a MacroPartial which contains a simple form and i used it in RTE. it posts on surfacecontroller and I am trying to set viewdata on error but its empty.
I tried to show viewdata with both ways @ViewData["error"] and because it is a macro i tried this one @ViewContext.ParentActionViewContext.ParentActionViewContext.ViewData["error"].
No luck! can someone help me?
Note: if i use the same form without macropartial then it works fine and i got viewdata
Yasir
Yasir,
Can you paste the code for your controller?
Regards
Ismail
is working on a reply...