1

I am trying to add a very basic form with required field validation, but upon submission of the form, getting following error.

This happens only when 'RenderFormScrips()' are added (as highlighed in the screenshot below). And there is nothing special happening here. Following steps mentioned in Sitecore documentation here. https://doc.sitecore.com/developers/93/sitecore-experience-manager/en/add-a-form-to-a-webpage.html

Has anyone experience similar error before? Would really appreciate some pointers here.

enter image description here Detailed error message:

System.Web.HttpUnhandledException
  HResult=0x80004005
  Message=An unhandled exception occurred.
  Source=Sitecore.Mvc
  StackTrace:
   at Sitecore.Mvc.Pipelines.MvcEvents.Exception.ShowAspNetErrorMessage.ShowErrorMessage(ExceptionContext exceptionContext, ExceptionArgs args)
   at Sitecore.Mvc.Pipelines.MvcEvents.Exception.ShowAspNetErrorMessage.Process(ExceptionArgs args)
   at Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args)
   at Sitecore.Pipelines.DefaultCorePipelineManager.Run(String pipelineName, PipelineArgs args, String pipelineDomain, Boolean failIfNotExists)
   at Sitecore.Pipelines.DefaultCorePipelineManager.Run(String pipelineName, PipelineArgs args, String pipelineDomain)
   at Sitecore.Mvc.Pipelines.PipelineService.RunPipeline[TArgs](String pipelineName, TArgs args)
   at Sitecore.Mvc.Filters.PipelineBasedRequestFilter.OnException(ExceptionContext exceptionContext)
   at System.Web.Mvc.ControllerActionInvoker.InvokeExceptionFilters(ControllerContext controllerContext, IList`1 filters, Exception exception)
   at System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName)
   at System.Web.Mvc.Controller.ExecuteCore()
   at System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext)
   at Sitecore.Mvc.Controllers.ControllerRunner.ExecuteController(Controller controller)
   at Sitecore.Mvc.Controllers.ControllerRunner.Execute(TextWriter writer)
   at Sitecore.Mvc.Pipelines.Response.RenderRendering.ExecuteRenderer.Render(Renderer renderer, TextWriter writer, RenderRenderingArgs args)
   at Sitecore.Mvc.Pipelines.Response.RenderRendering.ExecuteRenderer.Process(RenderRenderingArgs args)
   at Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args)
   at Sitecore.Pipelines.DefaultCorePipelineManager.Run(String pipelineName, PipelineArgs args, String pipelineDomain, Boolean failIfNotExists)
   at Sitecore.Pipelines.DefaultCorePipelineManager.Run(String pipelineName, PipelineArgs args, String pipelineDomain)
   at Sitecore.Mvc.Pipelines.PipelineService.RunPipeline[TArgs](String pipelineName, TArgs args)
   at Sitecore.Mvc.Pipelines.Response.RenderPlaceholder.PerformRendering.Render(String placeholderName, TextWriter writer, RenderPlaceholderArgs args)
   at Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args)
   at Sitecore.Pipelines.DefaultCorePipelineManager.Run(String pipelineName, PipelineArgs args, String pipelineDomain, Boolean failIfNotExists)
   at Sitecore.Pipelines.DefaultCorePipelineManager.Run(String pipelineName, PipelineArgs args, String pipelineDomain)
   at Sitecore.Mvc.Pipelines.PipelineService.RunPipeline[TArgs](String pipelineName, TArgs args)
   at Sitecore.Mvc.Helpers.SitecoreHelper.RenderPlaceholderCore(String placeholderName, TextWriter writer)
   at Sitecore.Mvc.Helpers.SitecoreHelper.Placeholder(String placeholderName)
   at ASP._Page_Views_Shared_MVCLayout_cshtml.Execute() in c:\inetpub\wwwroot\local.kestrafinancial.com\Views\Shared\MVCLayout.cshtml:line 14
   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 System.Web.Mvc.Html.PartialExtensions.Partial(HtmlHelper htmlHelper, String partialViewName, Object model, ViewDataDictionary viewData)
   at Sitecore.Mvc.Presentation.ViewRenderer.Render(TextWriter writer)

This exception was originally thrown at this call stack: [External Code]

Inner Exception 1: NullReferenceException: Object reference not set to an instance of an object.

5
  • I would start by looking here ` at ASP._Page_Views_Shared_MVCLayout_cshtml.Execute() in c:\inetpub\wwwroot\local.kestrafinancial.com\Views\Shared\MVCLayout.cshtml:line 14`
    – Mark Cassidy
    Jan 6 at 20:00
  • @MarkCassidy Thanks for your feedback but as you can see, there's nothing specific going on in the Layout. It's a very basic MVC layout. Line #14 executes without error when page loads but same line throws exception upon form submission when 'RenderFormScrips()' is present on the layout.
    – kiran
    Jan 6 at 22:04
  • Are you sure it should be the placeholder content? Not main like in the tutorial you link?
    – asontu
    Jan 7 at 13:24
  • please ensure your placeholder on layout "content" same as MVC From rendering placeholder on page presentation. And if they are same and still issue i would suggest to add form on page from experiemce editor to see is there any missing step. Jan 8 at 3:32
  • @asontu Yes, I have content placeholder and not main in my layout.
    – kiran
    Jan 8 at 19:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.