Dr. Abdel. said:
Scott,
while you are correct in the explanation you give Dica about why he does
not see any effect, you didn't give him how to make it work.
Also "you'll hurt scalability adding your own threads." is not always
correct, there are situations when you need to submit a search (that is
taking too long) to work in the background....
What he is trying to accomplish may not make sense in the trivial example he
is using to explain his needs,
actually, yes, that's true, though the example i provided may not have made
much sense. i was trying to keep things as simple as possible while trying
to figure out basic threading in a asp.net environment and the example i
posted was from a vb.net windows form example i found. sorry for any
confusion. what i actually want to do is create a slide show to
automatically forward the user to the next page after 5 seconds:
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'// get the page number of the slide show //
If Request.QueryString("pg") <> "" Then
sThisPage = Request.QueryString("pg")
If IsNumeric(sThisPage) Then
iNextPage = CInt(sThisPage) + 1
End If
Else
iNextPage = 1
End If
Dim oNextPage As New NextSlideShowPage(iNextPage)
'// set up thread to do pausing //
Dim t As Thread
t = New Thread(AddressOf oNextPage.doNothing)
t.Start()
t.Sleep(5000) '// wait 5 seconds before advancing to next page //
oNextPage.getNextPage()
End Sub
here's the NextSlideSHowPage class:
Public Class NextSlideShowPage
Inherits System.Web.UI.Page
Private iNextPage As Integer
Sub New(ByVal iPage As Integer)
iNextPage = iPage
End Sub
Sub getNextPage()
Response.Redirect("slide_show.aspx?pg=" & iNextPage.ToString)
End Sub
Sub doNothing()
End Sub
End Class
this almost seems to work except i'm receiving a 'Response is not available
in this context' error message.
thoughts?
but it is a legitime question, that I would