Click here to Skip to main content
12,756,447 members (31,504 online)


AnswerRe: ASP.NET Pin
@AmitGajjar11-Dec-12 7:48
member@AmitGajjar11-Dec-12 7:48 
QuestionResponse.Redirect behavior Pin
Andrew Stoute10-Dec-12 10:11
memberAndrew Stoute10-Dec-12 10:11 
AnswerRe: Response.Redirect behavior Pin
David Mujica10-Dec-12 11:01
memberDavid Mujica10-Dec-12 11:01 
GeneralRe: Response.Redirect behavior Pin
Andrew Stoute10-Dec-12 11:16
memberAndrew Stoute10-Dec-12 11:16 
I'm beyond mortified that I didn't think of that. Especially since after posting the question I ran the code to check something else, but putting a break point there just never occurred to me. Sigh | :sigh:

Ok, so thanks to David's suggestion I have an answer.

As it is written that code will throw an exception on the Response.Redirect with the following message:
{Unable to evaluate expression because the code is optimized or a native frame is on top of the call stack.}
However, it still does the redirect after going through the finally block.

Changing the Response.Redirect to
    Response.Redirect("SomePage.aspx", false);

will save it from throwing the exception, but will still run the code in the finally and any code after it and then will do the Redirect.

Live and learn.

modified 11-Dec-12 9:26am.

AnswerRe: Response.Redirect behavior Pin
Shameel10-Dec-12 22:28
memberShameel10-Dec-12 22:28 
AnswerRe: Response.Redirect behavior Pin
@AmitGajjar11-Dec-12 7:54
member@AmitGajjar11-Dec-12 7:54 
AnswerRe: Response.Redirect behavior Pin
ryanb3112-Dec-12 5:36
memberryanb3112-Dec-12 5:36 
GeneralRe: Response.Redirect behavior Pin
Andrew Stoute12-Dec-12 5:46
memberAndrew Stoute12-Dec-12 5:46 
QuestionERROR while updating image in database Pin
Ani199110-Dec-12 7:18
memberAni199110-Dec-12 7:18 
GeneralRe: ERROR while updating image in database Pin
jkirkerx10-Dec-12 11:37
memberjkirkerx10-Dec-12 11:37 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Advertise | Privacy | Mobile
Web02 | 2.8.170217.1 | Last Updated 22 Feb 2017
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid