Asp.net 中 web.config中的customerror可以设置用户自定义的错误处理页面
问题是如何在错误处理页面 得到出错页面的 错误详细信息我试过在application_error中catch e但是错误不真实:
Server.GetLastError().ToString()
"System.Web.HttpException: Parser Error: External component has thrown an exception. ---> System.Web.HttpException: External component has thrown an exception. ---> System.Web.HttpCompileException: External component has thrown an exception.
at System.Web.Compilation.BaseCompiler.ThrowIfCompilerErrors(CompilerResults results, CodeDomProvider codeProvider, CodeCompileUnit sourceData, String sourceFile, String sourceString)
at System.Web.Compilation.BaseCompiler.GetCompiledType()
at System.Web.UI.UserControlParser.CompileIntoType()
at System.Web.UI.TemplateParser.GetParserCacheItemThroughCompilation()
--- End of inner exception stack trace ---
at System.Web.UI.TemplateParser.GetParserCacheItemInternal(Boolean fCreateIfNotFound)
at System.Web.UI.TemplateParser.GetParserCacheItemWithNewConfigPath()
at System.Web.UI.TemplateControlParser.GetReferencedType(TemplateControlParser parser, String virtualPath)
at System.Web.UI.TemplateControlParser.GetUserControlType(String virtualPath)
at System.Web.UI.TemplateControlParser.ProcessDirective(String directiveName, IDictionary directive)
at System.Web.UI.TemplateParser.ParseStringInternal(String text)
at System.Web.UI.TemplateParser.ParseString(String text, String virtualPath, String basePhysicalDir)
--- End of inner exception stack trace ---
at System.Web.UI.TemplateParser.ParseString(String text, String virtualPath, String basePhysicalDir)
at System.Web.UI.TemplateParser.ParseFile(String filename, String virtualPath)
at System.Web.UI.TemplateParser.Parse()
at System.Web.UI.TemplateParser.GetParserCacheItemThroughCompilation()
at System.Web.UI.TemplateParser.GetParserCacheItemInternal(Boolean fCreateIfNotFound)
at System.Web.UI.TemplateParser.GetParserCacheItemWithNewConfigPath()
at System.Web.UI.TemplateParser.GetParserCacheItem()
at System.Web.UI.TemplateControlParser.CompileAndGetParserCacheItem(String virtualPath, String inputFile, HttpContext context)
at System.Web.UI.TemplateControlParser.GetCompiledInstance(String virtualPath, String inputFile, HttpContext context)
at System.Web.UI.PageParser.GetCompiledPageInstance(String virtualPath, String inputFile, HttpContext context)
at System.Web.UI.PageHandlerFactory.GetHandler(HttpContext context, String requestType, String url, String path)
at System.Web.HttpApplication.MapHttpHandler(HttpContext context, String requestType, String path, String pathTranslated, Boolean useAppConfig)
at System.Web.MapHandlerExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)"如何得到真实的页面错误信息 就象aspx.net自己的错误显示的错误
Line:34
error: ;needed
.......
问题是如何在错误处理页面 得到出错页面的 错误详细信息我试过在application_error中catch e但是错误不真实:
Server.GetLastError().ToString()
"System.Web.HttpException: Parser Error: External component has thrown an exception. ---> System.Web.HttpException: External component has thrown an exception. ---> System.Web.HttpCompileException: External component has thrown an exception.
at System.Web.Compilation.BaseCompiler.ThrowIfCompilerErrors(CompilerResults results, CodeDomProvider codeProvider, CodeCompileUnit sourceData, String sourceFile, String sourceString)
at System.Web.Compilation.BaseCompiler.GetCompiledType()
at System.Web.UI.UserControlParser.CompileIntoType()
at System.Web.UI.TemplateParser.GetParserCacheItemThroughCompilation()
--- End of inner exception stack trace ---
at System.Web.UI.TemplateParser.GetParserCacheItemInternal(Boolean fCreateIfNotFound)
at System.Web.UI.TemplateParser.GetParserCacheItemWithNewConfigPath()
at System.Web.UI.TemplateControlParser.GetReferencedType(TemplateControlParser parser, String virtualPath)
at System.Web.UI.TemplateControlParser.GetUserControlType(String virtualPath)
at System.Web.UI.TemplateControlParser.ProcessDirective(String directiveName, IDictionary directive)
at System.Web.UI.TemplateParser.ParseStringInternal(String text)
at System.Web.UI.TemplateParser.ParseString(String text, String virtualPath, String basePhysicalDir)
--- End of inner exception stack trace ---
at System.Web.UI.TemplateParser.ParseString(String text, String virtualPath, String basePhysicalDir)
at System.Web.UI.TemplateParser.ParseFile(String filename, String virtualPath)
at System.Web.UI.TemplateParser.Parse()
at System.Web.UI.TemplateParser.GetParserCacheItemThroughCompilation()
at System.Web.UI.TemplateParser.GetParserCacheItemInternal(Boolean fCreateIfNotFound)
at System.Web.UI.TemplateParser.GetParserCacheItemWithNewConfigPath()
at System.Web.UI.TemplateParser.GetParserCacheItem()
at System.Web.UI.TemplateControlParser.CompileAndGetParserCacheItem(String virtualPath, String inputFile, HttpContext context)
at System.Web.UI.TemplateControlParser.GetCompiledInstance(String virtualPath, String inputFile, HttpContext context)
at System.Web.UI.PageParser.GetCompiledPageInstance(String virtualPath, String inputFile, HttpContext context)
at System.Web.UI.PageHandlerFactory.GetHandler(HttpContext context, String requestType, String url, String path)
at System.Web.HttpApplication.MapHttpHandler(HttpContext context, String requestType, String path, String pathTranslated, Boolean useAppConfig)
at System.Web.MapHandlerExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)"如何得到真实的页面错误信息 就象aspx.net自己的错误显示的错误
Line:34
error: ;needed
.......
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货