views:

27

answers:

0

This is related to this question but I've got specific information now.

I've got a problem where my site won't load for a second visitor if the page is running a report for the first visitor. This is what happens.

  1. User 1 comes to the site
  2. User 1 runs a report that takes 30 seconds.
  3. User 2 comes to the site
  4. User 2 waits until user 1 report is done then the page loads.

So I've got a button on the page and when it's clicked it runs the report. For testing purposes it just sleeps for 10 seconds.

Threading.Thread.Sleep(10000)

I've narrowed the part where the page hangs for the second user at this part.

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

Dim isLoggedIn As Boolean = CType(Session("LoggedIn"), Boolean) 

If isLoggedIn = False Then
        Response.Redirect("Login.aspx") 'This is the line that hangs
End If

End Sub

If I comment out the Response.Redirect line everything works fine. The page will load for the second visitor and the report will finish for the first. If it's uncommented, it will cause the problem I am having. What is going on here? Why would redirecting cause this?