Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Redirect not working properly when using a timer??

Status
Not open for further replies.

BigRedTexas

Programmer
Mar 14, 2002
22
0
0
US
I'm trying to redirect to a certain page after 3 seconds but when the timer fires off and it hits the redirect, nothing happens. If I put the same redirect code behind a button, it works fine. Does anyone have a clue what could be causing this?
 
ya I might

Need to see code how you wired up the timer. That'l do donkey, that'l do
[bravo] Mark
 
Zarcom, here goes:

"Private Sub tmrRedirect_Elapsed(ByVal sender As System.Object, ByVal e As System.Timers.ElapsedEventArgs) Handles tmrRedirect.Elapsed


Dim respString As String
respString = viewState("RouteForm") + "?UserName=" + viewState("UserName")
respString = respString + "&UserPriv=" + viewState("UserPriv") + "&Training=" + bTraining.ToString + "&BranchManagerId=" + viewState("BranchManagerId")
Response.Redirect(respString)

End Sub"

This is fired off by the timer which I first set in the Page_Load but now have it just set in the properties grid of the timer itself in the designer. What is also weird is after the redirect, the code hits the same redirect again. Any help you can give me would be good.

Thanks, Scott
 
Have you tried stepping through to see if the timer elapsed event is being fired?

Even though you set the properties in the designer you still have to start the timer.

i would do a step through to see if the response.redirect is gettting hit. That'l do donkey, that'l do
[bravo] Mark
 
Zarcam, that's just it, I did step through it and it's hitting it every time. That's why I'm confused.

Scott
 
I am not sure what you mean then does it just jump over the redirect statment and keep goin? I am not sure what you meant when you said this:What is also weird is after the redirect, the code hits the same redirect again

Not sure if this is related or not but stop the timer before redirecting. Since a redirect stops execution of the current page and goes to a new one.

That'l do donkey, that'l do
[bravo] Mark
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top