I have created a macro that can be used in a rich text editor that inserts a form into a page. The form is rendered using Html.Action.
If there is a server side validation error, I add an error to the ModelState and use return CurrentUmbracoPage(), but this doesn't work - the validation message is not displayed and the form is shown in the initial blank state.
Similarly, after a successful POST, I set a variable in TempData and use return RedirectToCurrentUmbracoPage(). The page redirects but the TempData is empty.
What is happening? Is it something to do with how macros are rendered in rich text editors? How can I fix it?
Adding a form as a macro in a RTE with MVC
I have created a macro that can be used in a rich text editor that inserts a form into a page. The form is rendered using
Html.Action
.If there is a server side validation error, I add an error to the ModelState and use
return CurrentUmbracoPage()
, but this doesn't work - the validation message is not displayed and the form is shown in the initial blank state.Similarly, after a successful POST, I set a variable in
TempData
and use returnRedirectToCurrentUmbracoPage()
. The page redirects but the TempData is empty.What is happening? Is it something to do with how macros are rendered in rich text editors? How can I fix it?
is working on a reply...