Link to home
Start Free TrialLog in
Avatar of sowmyan
sowmyan

asked on

ASP/VBScript Navigation problem

When a user clicks on a button, based on a set of criteria
in either ASP/VBScript the user either continues to remain in the same screen or navigates to another screen. This is the functionality I want.
I don't know what code to write to navigate to another screen. Could someone please tell me how this could be done?
This is true in either VBScript (SCRIPT Tag) or ASP script
(<% .. %> tag).
ASKER CERTIFIED SOLUTION
Avatar of rajgn
rajgn

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of rajgn
rajgn

Small correction to my answer...

DELETE the line 'response.end'
Avatar of sowmyan

ASKER

I did try out the "redirect" command but did not use the "redirect.clear" syntax and consequently got some "http header" error.
Are there any other techniques of navigation other than "redirect"?
You can't redirect once the HTML headers are written. That's whay you're getting that error. You can get rid of this in two ways.
1. Redirect before writing any HTML tags on your page. OR
2. Do it in the similar way as I did in my answer.
For this first you've to Buffer the response by setting response.buffer = true (this will not send the response immediately to the browser until you say response.end or response.flush)

Then do whatever checking you want. In between if you decide to go to some other page, first clear the buffer by saying response.clear then redirect the page. You can say response.end after the redirect sentence.

Well, coming to other techniques of navigation, one can't go to some other page until it's requested(by submitting a form or clicking a hyperlink) or you're directed(like in our case). I don't think there're some other methods of redirecting using ASP.