The @Html.Partial renders in the view renders the form correct.
The @Umbraco.RenderMacro renders and error because it can't find the partial view.
Error Log
2013-11-06 10:51:11,193 [25] WARN umbraco.macro - [Thread 32] Error loading Partial View (file: ~/Views/MacroPartials/Register.cshtml). Exception: System.InvalidOperationException: The partial view 'RegisterView' was not found or no view engine supports the searched locations. The following locations were searched:
~/Views/PartialViewMacro/RegisterView.aspx
~/Views/PartialViewMacro/RegisterView.ascx
~/Views/Shared/RegisterView.aspx
~/Views/Shared/RegisterView.ascx
~/Views/PartialViewMacro/RegisterView.cshtml
~/Views/PartialViewMacro/RegisterView.vbhtml
~/Views/Shared/RegisterView.cshtml
~/Views/Shared/RegisterView.vbhtml
at System.Web.Mvc.HtmlHelper.FindPartialView(ViewContext viewContext, String partialViewName, ViewEngineCollection viewEngineCollection)
at System.Web.Mvc.Html.PartialExtensions.Partial(HtmlHelper htmlHelper, String partialViewName, Object model, ViewDataDictionary viewData)
at ASP._Page_Views_MacroPartials_Register_cshtml.Execute() in xxxxxxxxx\Views\MacroPartials\Register.cshtml:line 4
at System.Web.WebPages.WebPageBase.ExecutePageHierarchy()
at System.Web.Mvc.WebViewPage.ExecutePageHierarchy()
at System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage)
at Umbraco.Web.Mvc.ControllerExtensions.RenderViewResultAsString(ControllerBase controller, ViewResultBase viewResult)
at Umbraco.Web.Macros.PartialViewMacroEngine.Execute(MacroModel macro, INode currentPage)
at umbraco.macro.LoadPartialViewMacro(MacroModel macro)
at umbraco.macro.renderMacro(Hashtable pageElements, Int32 pageId)
I have tried to move RegisterView.cshtml to the directories listed in the log, the view then loads but when the view loads it can't load the incorrect EditorTemplates and the form is not displayed as expected.
Problems Rendering Partial Views With EditorTemplates From Macros
I am attempting to integrate a custom form in a partial view with Umbraco and I am getting an error when I render the partial view though a macro.
Test code I am using in my template
Hi and welcome to Our!
You can be explicit with your partial path when calling Html.Partial, e.g
That might be helpful?
Jeavon
Thanks for the reply Jeavon.
Using the explicit path loads partial view from the MarcoPartial, but the correct editor templates are still not loaded is not loaded.
The result I get when rendering from the @Html.Partial
The output from the MacroRender Is below.
The form works in an existing MVC application, so its not using the Umbraco Membership Provider for registrations.
is working on a reply...