Confusing Response.Redirect Behavior

I am taking over some code and am having trouble understanding it. In the Page_Load, there is a Response.Redirect that Visual Studio says is being executed.

But then the remainder of the statements in Page_Load execute and THEN the Page_Load of the second page.

I thought Response.Redirect was immediate.  Here's the code:

        If Request.IsAuthenticated = True Then
            Response.Redirect("~/Somepage.aspx", False)
        End If

        ' Session has been abandoned and FormsAuthentication has been signed out.

        If IsNothing(Request.Cookies("UserInfo")) = False Then

Open in new window

Can anyone explain how this works? Am I witnessing the impossible?
If I execute the Response.Redirect, how can I get to the 'if' a few lines later?
Who is Participating?
Kyle AbrahamsConnect With a Mentor Senior .Net DeveloperCommented:
Response.Redirect("~/Somepage.aspx", False)

The false says don't end the response, eg: keep loading the page.

If you want to do it immediately, set that to true.
AIBMassAuthor Commented:
Sheesh. I won't be forgetting that. Thanks.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.