This problem drive me nuts. My code was working fine yesterday, and now i get this problem.
My main application windows open a Popup window to let the user choose for a specific event. Once the user accept, and that he entered the good authorization code for an event, the popup should close.
But right now, my "Page.Response.Redirect" in CloseWindow doesn't work anymore. It should work and just reload itself to fall into the PreInit. The PreInit should see "close" as action, then close. But nothing happen after Redirect... it doesn't reload or preinit.
I thought i caused this problem by adding a "virtual directory" to my application instead of having only "/", but i removed that and i still have the problem.
I've tried to put my page.response.redirect into a try-catch bloc, but it doesn't work and give me "Thread was being aborted" error, which is normal...
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Request.QueryString.Get("action") <> "close" Then
' Reset some Session variable
Session("EVENT_DESC") = ""
Session("EVENT_TYPE_KEY") = -1
Private Sub btnAccept_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnAccept.Click
' Some code here assign nEventKey according to what's found in the database
' If we found the item in the database, we can close the window
If nEventKey <> -1 Then
Private Sub CloseWindow()
Private Sub ChooseEvent_PreInit(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.PreInit
If Request.QueryString.Get("action") = "close" Then