S
Shathish
Hai
i am trying to write a multithreading asp.net application
this is the code
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
If Not IsPostBack Then
Try
DisplayLoadingMovie()
StartThread()
Catch ex As Exception
End Try
End If
End Sub
Private Sub GetPlaceHolders()
Try
Thread.Sleep(7000)
Dim strScript As String
strScript = "<script language=javascript>"
strScript &=
"window.parent.fra2.location.href='AfterLoading.aspx?Finished=Y';"
strScript &= "</script>"
Response.Write(strScript)
Catch ex As Exception
End Try
End Sub
Private Sub DisplayLoadingMovie()
Dim strScript As String
strScript = "<script language=javascript>"
strScript &=
"window.parent.fra2.location.href='Loading.aspx';"
strScript &= "</script>"
Response.Write(strScript)
End Sub
Private Sub StartThread()
Dim dlgThreadStart As ThreadStart = New ThreadStart(AddressOf
GetPlaceHolders)
Dim workerThread As Thread = New Thread(dlgThreadStart)
workerThread.Start()
End Sub
but wheni try to run the program the GetPlaceHolders method generates
a HttpException saying "Response is not available in this context"
Anyone got any idea how to work around the problem
i am trying to write a multithreading asp.net application
this is the code
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
If Not IsPostBack Then
Try
DisplayLoadingMovie()
StartThread()
Catch ex As Exception
End Try
End If
End Sub
Private Sub GetPlaceHolders()
Try
Thread.Sleep(7000)
Dim strScript As String
strScript = "<script language=javascript>"
strScript &=
"window.parent.fra2.location.href='AfterLoading.aspx?Finished=Y';"
strScript &= "</script>"
Response.Write(strScript)
Catch ex As Exception
End Try
End Sub
Private Sub DisplayLoadingMovie()
Dim strScript As String
strScript = "<script language=javascript>"
strScript &=
"window.parent.fra2.location.href='Loading.aspx';"
strScript &= "</script>"
Response.Write(strScript)
End Sub
Private Sub StartThread()
Dim dlgThreadStart As ThreadStart = New ThreadStart(AddressOf
GetPlaceHolders)
Dim workerThread As Thread = New Thread(dlgThreadStart)
workerThread.Start()
End Sub
but wheni try to run the program the GetPlaceHolders method generates
a HttpException saying "Response is not available in this context"
Anyone got any idea how to work around the problem