Click here to Skip to main content
15,896,500 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
In my asp.net website, i am using customerror defaultredirect property in web.config to redirect to error page (say, error.aspx) if any server side error comes. My issue is, on error on page abc.aspx, it is redirecting to error page (i put debugger in error.aspx and debugger is hitting that page) . However, page is not redirected to error.aspx on browser. Though page load of error.aspx is hit by debugger, in browser abc.aspx page is seen instead of error.aspx and no postback occurs on abc.aspx on error - the page remains still..

What is happening to behavior of custom error?? Anyhelp??
Thanks in advance...
Posted
Comments
[no name] 16-Jan-16 12:53pm    
Can you share relevant code how did you implement it. Click wizard "Improve Question" and append code.

Secondly it is hitting page_load of error.aspx but in browser it is rendering abc.aspx, confirm it.
Codes DeCodes 17-Jan-16 10:23am    
<customerror mode="on" defaultredirect="error.aspx" redirectmode="responserewrite">

Appology for code, i am using mobile phone for this post..
Indeed, it is hitting pageload of error.aspx but rendering abc.aspx in browser...
[no name] 17-Jan-16 10:38am    
Just cross check there may be logic in global.asax or page_error method in your current page.

Secondly you can set error page in IIS. Just check there somewhere it is overriding your logic.
Codes DeCodes 17-Jan-16 11:03am    
Just found that on removing redirectmode="responserewrite" from customerror tag, its rendering. However i have used this code to use Server.GetlastError() method. I need this method .
[no name] 17-Jan-16 11:16am    
Where did you write Server.GetlastError() in your page means in which page?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900