Greeting,
I have this sub in a page that runs a thread to change direction of a
page then redirects to a new page(please wait message page)which
checks for a global flag and returns to previous page if true. The
problem when I assign thread priority to highest, it just works like a
dream, otherwise, it produces an error:
----The type System.Web.HttpException
in Assembly System.Web, Version=1.0.5000.0,
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a is not
marked as serializable-----
Code:
*****In default page:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim NewThread As Thread = New Thread(AddressOf
ChangeDirection)
NewThread.Priority = ThreadPriority.Normal ''''********this
produces and error unless put to highest
NewThread.Start()
Response.Redirect("/Testing/WaitPage.aspx")
End Sub
Public Sub ChangeDirection()
Response.Write("<script>document.dir=""rtl""</script>")
Session("Finished") = True
End Sub
End Class
***********In WaitPage.aspx:
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
If Session("Finished") = False Then
Response.Write("<META HTTP-EQUIV=Refresh CONTENT=""3; URL="">
")
Label1.Text = "Processing. . ."
Else
Label1.Text = "Finished!"
Response.Write("<script>document.location.replace( ""default.aspx"")</>")
End If
End Sub
MTIA,
Grawsha