Hello All:
I have an asp.net solution which needs to be deployed on ShrarePoint2013
The solution has an aspx pages with server side controls, and is a part of a MasterPage
When deployed on the SP2013 environment, I am getting this error:
“The event handler 'OnClick' is not allowed in this page”
I have already updated the following entry in the web.config file.
<PageParserPath VirtualPath="/*" CompilationMode="Always" AllowServerSideScript="true" IncludeSubFolders="true" />
For the web.config i have updated manually all the refrences with 15.0 as compared to 14.0 earlier and updated layout references to point to the 15 Hive
Any ideas expect attaching the Onclick event handler in the code behind file?
This is the part of ULS log error that i get:
Application error when access /Pages/page1.aspx, Error=The event handler 'OnClick' is not allowed in this page. at System.Web.UI.TemplateParser.OnFoundEventHandler(String directiveName) at System.Web.UI.ControlBuilder.AddProperty(String filter, String name, String value, Boolean mainDirectiveMode) at System.Web.UI.ControlBuilder.PreprocessAttributes(ParsedAttributeCollection attribs) at System.Web.UI.ControlBuilder.Init(TemplateParser parser, ControlBuilder parentBuilder, Type type, String tagName, String id, IDictionary attribs) at System.Web.UI.ControlBuilder.CreateBuilderFromType(TemplateParser parser, ControlBuilder parentBuilder, Type type, String tagName, String id, IDictionary attribs, Int32 line, String sourceFileName) at System.Web.UI.ControlBuilder.CreateC... 08c90f9c-bda6-10eb-7bf5-29b94757ec2d04/08/2013 09:03:55.19* w3wp.exe (0x5038) 0x4ECC SharePoint Foundation General 8nca Medium ...hildBuilder(String filter, String tagName, IDictionary attribs, TemplateParser parser, ControlBuilder parentBuilder, String id, Int32 line, VirtualPath virtualPath, Type& childType, Boolean defaultProperty) at System.Web.UI.TemplateParser.ProcessBeginTag(Match match, String inputText) at System.Web.UI.TemplateParser.ParseStringInternal(String text, Encoding fileEncoding) 08c90f9c-bda6-10eb-7bf5-29b94757ec2d
04/08/2013 09:03:55.19 w3wp.exe (0x5038) 0x4ECC SharePoint Foundation Runtime tkau Unexpected System.Web.HttpException: The event handler 'OnClick' is not allowed in this page. at System.Web.UI.TemplateParser.OnFoundEventHandler(String directiveName) at System.Web.UI.ControlBuilder.AddProperty(String filter, String name, String value, Boolean mainDirectiveMode) at System.Web.UI.ControlBuilder.PreprocessAttributes(ParsedAttributeCollection attribs) at System.Web.UI.ControlBuilder.Init(TemplateParser parser, ControlBuilder parentBuilder, Type type, String tagName, String id, IDictionary attribs) at System.Web.UI.ControlBuilder.CreateBuilderFromType(TemplateParser parser, ControlBuilder parentBuilder, Type type, String tagName, String id, IDictionary attribs, Int32 line, String sourceFileName) at System.Web.UI.ControlBuilder.CreateChildBuilder(String filter, Str... 08c90f9c-bda6-10eb-7bf5-29b94757ec2d
04/08/2013 09:03:55.19* w3wp.exe (0x5038) 0x4ECC SharePoint Foundation Runtime tkau Unexpected ...ing tagName, IDictionary attribs, TemplateParser parser, ControlBuilder parentBuilder, String id, Int32 line, VirtualPath virtualPath, Type& childType, Boolean defaultProperty) at System.Web.UI.TemplateParser.ProcessBeginTag(Match match, String inputText) at System.Web.UI.TemplateParser.ParseStringInternal(String text, Encoding fileEncoding) 08c90f9c-bda6-10eb-7bf5-29b94757ec2d
04/08/2013 09:03:55.19 w3wp.exe (0x5038) 0x4ECC SharePoint Foundation General ajlz0 High Getting Error Message for Exception System.Web.HttpParseException (0x80004005): The event handler 'OnClick' is not allowed in this page. ---> System.Web.HttpParseException (0x80004005): The event handler 'OnClick' is not allowed in this page. ---> System.Web.HttpException (0x80004005): The event handler 'OnClick' is not allowed in this page. at System.Web.UI.TemplateParser.OnFoundEventHandler(String directiveName) at System.Web.UI.ControlBuilder.AddProperty(String filter, String name, String value, Boolean mainDirectiveMode) at System.Web.UI.ControlBuilder.PreprocessAttributes(ParsedAttributeCollection attribs) at System.Web.UI.ControlBuilder.Init(TemplateParser parser, ControlBuilder parentBuilder, Type type, String tagName, String id, IDictionary attribs) at System.We... 08c90f9c-bda6-10eb-7bf5-29b94757ec2d
04/08/2013 09:03:55.19* w3wp.exe (0x5038) 0x4ECC SharePoint Foundation General ajlz0 High ...b.UI.ControlBuilder.CreateBuilderFromType(TemplateParser parser, ControlBuilder parentBuilder, Type type, String tagName, String id, IDictionary attribs, Int32 line, String sourceFileName) at System.Web.UI.ControlBuilder.CreateChildBuilder(String filter, String tagName, IDictionary attribs, TemplateParser parser, ControlBuilder parentBuilder, String id, Int32 line, VirtualPath virtualPath, Type& childType, Boolean defaultProperty) at System.Web.UI.TemplateParser.ProcessBeginTag(Match match, String inputText) at System.Web.UI.TemplateParser.ParseStringInternal(String text, Encoding fileEncoding) at System.Web.UI.TemplateParser.ProcessException(Exception ex) at System.Web.UI.TemplateParser.ParseStringInternal(String text, Encoding fileEncoding) at System.Web.UI.Templa... 08c90f9c-bda6-10eb-7bf5-29b94757ec2d
04/08/2013 09:03:55.19* w3wp.exe (0x5038) 0x4ECC SharePoint Foundation General ajlz0 High ...teParser.ParseString(String text, VirtualPath virtualPath, Encoding fileEncoding) at System.Web.UI.TemplateParser.ParseString(String text, VirtualPath virtualPath, Encoding fileEncoding) at System.Web.UI.TemplateParser.ParseFile(String physicalPath, VirtualPath virtualPath) at System.Web.UI.TemplateParser.Parse() at System.Web.Compilation.BaseTemplateBuildProvider.get_CodeCompilerType() at System.Web.Compilation.BuildProvider.GetCompilerTypeFromBuildProvider(BuildProvider buildProvider) at System.Web.Compilation.BuildProvidersCompiler.ProcessBuildProviders() at System.Web.Compilation.BuildProvidersCompiler.PerformBuild() at System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath virtualPath) at System.Web.Compilation.BuildManager.GetVPathBuildResu... 08c90f9c-bda6-10eb-7bf5-29b94757ec2d
04/08/2013 09:03:55.19* w3wp.exe (0x5038) 0x4ECC SharePoint Foundation General ajlz0 High ...ltInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate) at System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate) at System.Web.Compilation.BuildManager.GetVirtualPathObjectFactory(VirtualPath virtualPath, HttpContext context, Boolean allowCrossApp, Boolean throwIfNotFound) at System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath(VirtualPath virtualPath, Type requiredBaseType, HttpContext context, Boolean allowCrossApp) at System.Web.UI.PageHandlerFactory.GetHandlerHelper(HttpContex... 08c90f9c-bda6-10eb-7bf5-29b94757ec2d
04/08/2013 09:03:55.19* w3wp.exe (0x5038) 0x4ECC SharePoint Foundation General ajlz0 High ...t context, String requestType, VirtualPath virtualPath, String physicalPath) at System.Web.HttpApplication.MaterializeHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean
Thanks
Puneet W