Error when ezSearch razor macro is rendering a FormlessPage with ajaxcontroltoolkit
When a page with a MaskedEditExtender control from the ajax control toolkit shows up in the search results of ezsearch the exception below is thrown. I think the problem is that the <form> tag is declared in the template so when the page is loaded by ezSearch it thinks it is a "form less page" which the ajax control toolkit doesn't like.
For the search results I don't need the MaskedEditExtender to render (obviously), is there a way I can tell get ezSearch not to try and render the macro or tell the macro not to render anything when called from ezSearch?
I tried wrapping the control in an if block to check for the presence of a form element but this doesn't seem to have helped.
I'm using version 7.0.3 if that makes any difference.
umbraco.macro - [Thread 73] Error loading Partial View (file: ~/Views/MacroPartials/ezSearch.cshtml). Exception: System.Web.HttpException (0x80004005): Error executing child request for handler 'Umbraco.Web.FormlessPage'. ---> System.Web.HttpUnhandledException (0x80004005): Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> System.NullReferenceException: Object reference not set to an instance of an object.
at AjaxControlToolkit.MaskedEditExtender.OnLoad(EventArgs e) in C:\Users\Stephen\Documents\Repos\Superexpert\AjaxControlToolkit\Server\AjaxControlToolkit\MaskedEdit\MaskedEditExtender.cs:line 96
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.HandleError(Exception e)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest()
at System.Web.UI.Page.ProcessRequest(HttpContext context)
at System.Web.HttpServerUtility.Execute(IHttpHandler handler, TextWriter writer, Boolean preserveForm, Boolean setPreviousPage)
at System.Web.HttpServerUtilityWrapper.Execute(IHttpHandler handler, TextWriter writer, Boolean preserveForm)
at Umbraco.Web.UmbracoHelper.RenderMacro(macro m, IDictionary`2 parameters, page umbracoPage)
at Umbraco.Web.PropertyEditors.ValueConverters.RteMacroRenderingValueConverter.<>c__DisplayClass7.<RenderRteMacros>b__1(String macroAlias, Dictionary`2 macroAttributes)
at Umbraco.Core.Macros.MacroTagParser.ParseMacros(String text, Action`1 textFoundCallback, Action`2 macroFoundCallback)
at Umbraco.Web.PropertyEditors.ValueConverters.RteMacroRenderingValueConverter.RenderRteMacros(String source, Boolean preview)
at Umbraco.Web.PropertyEditors.ValueConverters.RteMacroRenderingValueConverter.ConvertDataToSource(PublishedPropertyType propertyType, Object source, Boolean preview)
at System.Lazy`1.CreateValue()
at System.Lazy`1.LazyInitValue()
at Umbraco.Web.PublishedCache.XmlPublishedCache.XmlPublishedProperty.<.ctor>b__1()
at System.Lazy`1.CreateValue()
at System.Lazy`1.LazyInitValue()
at Umbraco.Web.PublishedCache.XmlPublishedCache.XmlPublishedProperty.get_Value()
at ASP._Page_Views_MacroPartials_ezSearch_cshtml.<>c__DisplayClasse.<RenderContentResult>b__c(TextWriter __razor_helper_writer) in d:\Umbraco\Views\MacroPartials\ezSearch.cshtml:line 227
at ASP._Page_Views_MacroPartials_ezSearch_cshtml.<>c__DisplayClassa.<RenderResults>b__9(TextWriter __razor_helper_writer) in d:\Umbraco\Views\MacroPartials\ezSearch.cshtml:line 210
at ASP._Page_Views_MacroPartials_ezSearch_cshtml.Execute() in d:\Umbraco\Views\MacroPartials\ezSearch.cshtml:line 147
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.Core.Profiling.ProfilingView.Render(ViewContext viewContext, TextWriter writer)
at Umbraco.Web.Mvc.ControllerExtensions.RenderViewResultAsString(ControllerBase controller, ViewResultBase viewResult)
at Umbraco.Web.Macros.PartialViewMacroEngine.Execute(MacroModel macro, IPublishedContent content)
at umbraco.macro.LoadPartialViewMacro(MacroModel macro)
at umbraco.macro.renderMacro(Hashtable pageElements, Int32 pageId)
Error when ezSearch razor macro is rendering a FormlessPage with ajaxcontroltoolkit
When a page with a MaskedEditExtender control from the ajax control toolkit shows up in the search results of ezsearch the exception below is thrown. I think the problem is that the <form> tag is declared in the template so when the page is loaded by ezSearch it thinks it is a "form less page" which the ajax control toolkit doesn't like.
For the search results I don't need the MaskedEditExtender to render (obviously), is there a way I can tell get ezSearch not to try and render the macro or tell the macro not to render anything when called from ezSearch?
I tried wrapping the control in an if block to check for the presence of a form element but this doesn't seem to have helped.
<%If Page.Form IsNot Nothing Then%>
<ajaxToolkit:MaskedEditExtender runat="server" ... />
<%End If%>
I'm using version 7.0.3 if that makes any difference.
umbraco.macro - [Thread 73] Error loading Partial View (file: ~/Views/MacroPartials/ezSearch.cshtml). Exception: System.Web.HttpException (0x80004005): Error executing child request for handler 'Umbraco.Web.FormlessPage'. ---> System.Web.HttpUnhandledException (0x80004005): Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> System.NullReferenceException: Object reference not set to an instance of an object.
at AjaxControlToolkit.MaskedEditExtender.OnLoad(EventArgs e) in C:\Users\Stephen\Documents\Repos\Superexpert\AjaxControlToolkit\Server\AjaxControlToolkit\MaskedEdit\MaskedEditExtender.cs:line 96
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.HandleError(Exception e)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest()
at System.Web.UI.Page.ProcessRequest(HttpContext context)
at System.Web.HttpServerUtility.ExecuteInternal(IHttpHandler handler, TextWriter writer, Boolean preserveForm, Boolean setPreviousPage, VirtualPath path, VirtualPath filePath, String physPath, Exception error, String queryStringOverride)
at System.Web.HttpServerUtility.ExecuteInternal(IHttpHandler handler, TextWriter writer, Boolean preserveForm, Boolean setPreviousPage, VirtualPath path, VirtualPath filePath, String physPath, Exception error, String queryStringOverride)
at System.Web.HttpServerUtility.Execute(IHttpHandler handler, TextWriter writer, Boolean preserveForm, Boolean setPreviousPage)
at System.Web.HttpServerUtilityWrapper.Execute(IHttpHandler handler, TextWriter writer, Boolean preserveForm)
at Umbraco.Web.UmbracoHelper.RenderMacro(macro m, IDictionary`2 parameters, page umbracoPage)
at Umbraco.Web.PropertyEditors.ValueConverters.RteMacroRenderingValueConverter.<>c__DisplayClass7.<RenderRteMacros>b__1(String macroAlias, Dictionary`2 macroAttributes)
at Umbraco.Core.Macros.MacroTagParser.ParseMacros(String text, Action`1 textFoundCallback, Action`2 macroFoundCallback)
at Umbraco.Web.PropertyEditors.ValueConverters.RteMacroRenderingValueConverter.RenderRteMacros(String source, Boolean preview)
at Umbraco.Web.PropertyEditors.ValueConverters.RteMacroRenderingValueConverter.ConvertDataToSource(PublishedPropertyType propertyType, Object source, Boolean preview)
at System.Lazy`1.CreateValue()
at System.Lazy`1.LazyInitValue()
at Umbraco.Web.PublishedCache.XmlPublishedCache.XmlPublishedProperty.<.ctor>b__1()
at System.Lazy`1.CreateValue()
at System.Lazy`1.LazyInitValue()
at Umbraco.Web.PublishedCache.XmlPublishedCache.XmlPublishedProperty.get_Value()
at ASP._Page_Views_MacroPartials_ezSearch_cshtml.<>c__DisplayClasse.<RenderContentResult>b__c(TextWriter __razor_helper_writer) in d:\Umbraco\Views\MacroPartials\ezSearch.cshtml:line 227
at ASP._Page_Views_MacroPartials_ezSearch_cshtml.<>c__DisplayClassa.<RenderResults>b__9(TextWriter __razor_helper_writer) in d:\Umbraco\Views\MacroPartials\ezSearch.cshtml:line 210
at ASP._Page_Views_MacroPartials_ezSearch_cshtml.Execute() in d:\Umbraco\Views\MacroPartials\ezSearch.cshtml:line 147
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.Core.Profiling.ProfilingView.Render(ViewContext viewContext, TextWriter writer)
at Umbraco.Web.Mvc.ControllerExtensions.RenderViewResultAsString(ControllerBase controller, ViewResultBase viewResult)
at Umbraco.Web.Macros.PartialViewMacroEngine.Execute(MacroModel macro, IPublishedContent content)
at umbraco.macro.LoadPartialViewMacro(MacroModel macro)
at umbraco.macro.renderMacro(Hashtable pageElements, Int32 pageId)
is working on a reply...