IT Community - Software Programming, Web Development and Technical Support

If I use Response.Redirect in try block exception occurred in c#, Why?

This is a discussion on If I use Response.Redirect in try block exception occurred in c#, Why? within the C# Programming forums, part of the Software Development category; If I use Response.Redirect in try block exception occurred in c#, Why?...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Software Development > C# Programming

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 07-18-2007, 10:35 PM
kingmaker kingmaker is offline
D-Web Genius
 
Join Date: Jun 2007
Posts: 882
kingmaker is on a distinguished road
Send a message via Yahoo to kingmaker
Default If I use Response.Redirect in try block exception occurred in c#, Why?

If I use Response.Redirect in try block exception occurred in c#, Why?
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 07-19-2007, 04:51 AM
Gopisoft Gopisoft is offline
D-Web Sr.Programmer
 
Join Date: Feb 2007
Posts: 117
Gopisoft is on a distinguished road
Default Re: If I use Response.Redirect in try block exception occurred in c#, Why?

In Normal Scenario, Response.End ends the Page Execution and thenthe excetion shifts tp Application_EndRequest.But when we Use Response.Redirect Method ,the Method shifting to Application_EndRequest does not occur because the Response.End Methodis called By the Response.Redirect Method Internally.

So the Server Does not ends its Request and A Exception is Thrown

To Avoid This,

we can use overload, Response.Redirect(String url, bool endResponse) that passes false for the endResponse parameter to suppress the internal call to Response.End So that the Response.End Explicitly called after the Response.Redirect Method To exceute and End the Process Correctly.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
What is the difference between Server.Transfer and Response.Redirect?.. H2o ASP and ASP.NET Programming 4 11-22-2007 05:25 AM
Exception "security block" while connecting to bluetooth device S.Vinothkumar Mobile Software Development 13 11-10-2007 03:19 AM
Difference between Server.Transfer and Response.Redirect Arun ASP and ASP.NET Programming 4 09-19-2007 10:52 PM
HTTP Web Response Exception - I cant able to trap. prasannavigneshr Windows Mobile 27 09-19-2007 08:28 AM
What is the difference between Server.Transfer and Response.Redirect? Why would I cho prasath ASP and ASP.NET Programming 1 07-19-2007 02:41 AM


All times are GMT -7. The time now is 09:45 PM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.

SEO by vBSEO 3.0.0