[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Confusing Response.Redirect Behavior

Posted on 2012-03-13
2
Medium Priority
?
346 Views
Last Modified: 2012-03-13
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
            Session.Abandon()
            FormsAuthentication.SignOut()
            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?
0
Comment
Question by:AIBMass
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 41

Accepted Solution

by:
Kyle Abrahams earned 2000 total points
ID: 37715340
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.
0
 

Author Closing Comment

by:AIBMass
ID: 37715367
Sheesh. I won't be forgetting that. Thanks.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question