1

This is a branch off of my other question here

I am now able to add my javascript in asynchronously but it does not redirect my page properly.

Currently I use this to redirect my page

Response.AddHeader("Refresh", "1;URL=mypage.aspx")

The reason I use the Response.AddHeader is so that I can delay the redirect

Is there something different I need to do with this to make it add the header asynchronously?

Community
  • 1
  • 1
Jamie Taylor
  • 3,500
  • 21
  • 65
  • 99

1 Answers1

0

Have you tried redirecting with javascript?

setTimeout("window.location='mypage.aspx';", 1000);
Tim B James
  • 20,084
  • 4
  • 73
  • 103
  • As a last resort i'd use javascript but was wondering if there was a .Net way of doing it – Jamie Taylor May 26 '11 at 14:57
  • If you are doing in the .Net why then why not just use `Response.Redirect`? To get a delay before the redirect put the thread to sleep `Thread.Sleep(1000)` – Tim B James May 26 '11 at 15:07
  • If I use `Thread.Sleep` it stops my jQuery from running the exit functions – Jamie Taylor May 26 '11 at 16:44
  • ahh sorry didnt realise u had some jquery running. might as well go with the javascript method then if you are already running javascript! – Tim B James May 26 '11 at 17:22