Showing posts with label asax. Show all posts
Showing posts with label asax. Show all posts

Saturday, March 24, 2012

Strange error handling problem

hi guys,

I have enabled error handling in my application through web.config and also using global.asax file.. but whenever there's any error in my application I am just transferred to default error page which is defined in web.config..

I want the code in global.asax file to take care of the error message as compared to web.config file..

what am i missing ??

web.config


<customErrors mode="RemoteOnly" defaultRedirect="~/Error/Default.aspx"/>

Global.asax


' Fires when an error occurs
Dim ptr As New SystemFunctions
ptr.SendExceptionReport(Session, Request, Server.GetLastError().InnerException, "MyWebApp")
Response.Redirect("~/Error/")
Hi,

Remove the Response.Redirect in the Global.asax file.

The default error page will anyway be shown since you specify it in the web.config. The problem is when there is a response.redirect, it is first executed irrespective of other statements.

Try removing the response.redirect.

write back if it doesn't help.

thanks.

Strange Errors...Don't Understand

I recently implemented error processing on my .net website, where I send
myself an email from global.asax on an application error. In the last two
days I have gotten a "The file '/detail.aspx' does not exits" type
error--with two different file names. In both cases, I searched my entire
source for the '/detail.aspx' reference and it doesn't exist.

What could be causing this error? Text of error email I sent to myself
follows...

The file '/detail.aspx' does not exist.

System.Web.HttpException: The file '/detail.aspx' does not exist. at
System.Web.UI.Util.CheckVirtualFileExists(VirtualP ath virtualPath) at
System.Web.Compilation.BuildManager.GetVPathBuildR esultInternal(VirtualPath
virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean
allowBuildInPrecompile) at
System.Web.Compilation.BuildManager.GetVPathBuildR esultWithNoAssert(HttpContext
context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp,
Boolean allowBuildInPrecompile) at
System.Web.Compilation.BuildManager.GetVirtualPath ObjectFactory(VirtualPath
virtualPath, HttpContext context, Boolean allowCrossApp, Boolean noAssert) at
System.Web.Compilation.BuildManager.CreateInstance FromVirtualPath(VirtualPath
virtualPath, Type requiredBaseType, HttpContext context, Boolean
allowCrossApp, Boolean noAssert) at
System.Web.UI.PageHandlerFactory.GetHandlerHelper( HttpContext context, String
requestType, VirtualPath virtualPath, String physicalPath) at
System.Web.UI.PageHandlerFactory.System.Web.IHttpH andlerFactory2.GetHandler(HttpContext
context, String requestType, VirtualPath virtualPath, String physicalPath) at
System.Web.HttpApplication.MapHttpHandler(HttpCont ext context, String
requestType, VirtualPath path, String pathTranslated, Boolean useAppConfig)
at
System.Web.HttpApplication.MapHandlerExecutionStep .System.Web.HttpApplication.IExecutionStep.Execute ()
at System.Web.HttpApplication.ExecuteStep(IExecutionS tep step, Boolean&
completedSynchronously)See if this helps :

http://www.velocityreviews.com/foru...-aspnet-20.html
Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaol : http://asp.net.do/foros/
======================================
"Paul Buzza, oldster using new tools" <PaulBuzzaoldsterusingnewtools@.discussions.microsof t.comwrote in message
news:9550498C-9323-4D8A-BA54-555CCFE19734@.microsoft.com...

Quote:

Originally Posted by

>I recently implemented error processing on my .net website, where I send
myself an email from global.asax on an application error. In the last two
days I have gotten a "The file '/detail.aspx' does not exits" type
error--with two different file names. In both cases, I searched my entire
source for the '/detail.aspx' reference and it doesn't exist.
>
What could be causing this error? Text of error email I sent to myself
follows...
>
The file '/detail.aspx' does not exist.
>
System.Web.HttpException: The file '/detail.aspx' does not exist. at
System.Web.UI.Util.CheckVirtualFileExists(VirtualP ath virtualPath) at
System.Web.Compilation.BuildManager.GetVPathBuildR esultInternal(VirtualPath
virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean
allowBuildInPrecompile) at
System.Web.Compilation.BuildManager.GetVPathBuildR esultWithNoAssert(HttpContext
context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp,
Boolean allowBuildInPrecompile) at
System.Web.Compilation.BuildManager.GetVirtualPath ObjectFactory(VirtualPath
virtualPath, HttpContext context, Boolean allowCrossApp, Boolean noAssert) at
System.Web.Compilation.BuildManager.CreateInstance FromVirtualPath(VirtualPath
virtualPath, Type requiredBaseType, HttpContext context, Boolean
allowCrossApp, Boolean noAssert) at
System.Web.UI.PageHandlerFactory.GetHandlerHelper( HttpContext context, String
requestType, VirtualPath virtualPath, String physicalPath) at
System.Web.UI.PageHandlerFactory.System.Web.IHttpH andlerFactory2.GetHandler(HttpContext
context, String requestType, VirtualPath virtualPath, String physicalPath) at
System.Web.HttpApplication.MapHttpHandler(HttpCont ext context, String
requestType, VirtualPath path, String pathTranslated, Boolean useAppConfig)
at
System.Web.HttpApplication.MapHandlerExecutionStep .System.Web.HttpApplication.IExecutionStep.Execute ()
at System.Web.HttpApplication.ExecuteStep(IExecutionS tep step, Boolean&
completedSynchronously)


Juan,

Thank you. It was the "click" I needed. My old version of my site had the
named files on which I see the errors. If someone had a saved bookmark to
one of my old pages, this is the error I see. All I have to do is handle the
404 error with a separate error page, and tell the originator to update their
bookmarks.

Paul

"Juan T. Llibre" wrote:

Quote:

Originally Posted by

See if this helps :
>
http://www.velocityreviews.com/foru...-aspnet-20.html
>
>
>
>
Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espa?ol : http://asp.net.do/foros/
======================================
"Paul Buzza, oldster using new tools" <PaulBuzzaoldsterusingnewtools@.discussions.microsof t.comwrote in message
news:9550498C-9323-4D8A-BA54-555CCFE19734@.microsoft.com...

Quote:

Originally Posted by

I recently implemented error processing on my .net website, where I send
myself an email from global.asax on an application error. In the last two
days I have gotten a "The file '/detail.aspx' does not exits" type
error--with two different file names. In both cases, I searched my entire
source for the '/detail.aspx' reference and it doesn't exist.

What could be causing this error? Text of error email I sent to myself
follows...

The file '/detail.aspx' does not exist.

System.Web.HttpException: The file '/detail.aspx' does not exist. at
System.Web.UI.Util.CheckVirtualFileExists(VirtualP ath virtualPath) at
System.Web.Compilation.BuildManager.GetVPathBuildR esultInternal(VirtualPath
virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean
allowBuildInPrecompile) at
System.Web.Compilation.BuildManager.GetVPathBuildR esultWithNoAssert(HttpContext
context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp,
Boolean allowBuildInPrecompile) at
System.Web.Compilation.BuildManager.GetVirtualPath ObjectFactory(VirtualPath
virtualPath, HttpContext context, Boolean allowCrossApp, Boolean noAssert) at
System.Web.Compilation.BuildManager.CreateInstance FromVirtualPath(VirtualPath
virtualPath, Type requiredBaseType, HttpContext context, Boolean
allowCrossApp, Boolean noAssert) at
System.Web.UI.PageHandlerFactory.GetHandlerHelper( HttpContext context, String
requestType, VirtualPath virtualPath, String physicalPath) at
System.Web.UI.PageHandlerFactory.System.Web.IHttpH andlerFactory2.GetHandler(HttpContext
context, String requestType, VirtualPath virtualPath, String physicalPath) at
System.Web.HttpApplication.MapHttpHandler(HttpCont ext context, String
requestType, VirtualPath path, String pathTranslated, Boolean useAppConfig)
at
System.Web.HttpApplication.MapHandlerExecutionStep .System.Web.HttpApplication.IExecutionStep.Execute ()
at System.Web.HttpApplication.ExecuteStep(IExecutionS tep step, Boolean&
completedSynchronously)


>
>
>