that will mean I will have to do the test for redirection prior to the onclick, right? If the page is already loaded, then clicking on the link wont do any further checking, just go straight to the ajax - is that right? So would there be a way to do a check for something (say is the session still active) during the onclick?
Main Topics
Browse All Topics





by: UnexplainedWaysPosted on 2008-06-28 at 00:55:29ID: 21889799
All Ajax will do is "go to a webpage" and retrieve the contents and put it into xmlHttp.responseText. So if the asp page redirects all it will do is return the different page.
The simplest way i can think about it might be a hack but it could put you onto the right idea.
Instead of returning a whole page, when you want to re-direct, how about you just return this "REDIRECT=thatPage.asp".
This way, you can do something like
get substring of xmlHttp.responseText
does it = "RESULT="
if so, then get the rest of the text thatPage.asp
then do a javascript re-direct to that variable.
else
do what you normally do.