Redirects the client’s browser to another page.
To redirect |
Use |
---|---|
From a 4GL Web page |
|
From a Web page that is not 4GL Web-enabled |
Redirects the client’s browser to another page. Use this method to navigate programmatically to a new page. This method is for 4GL JSP targets only.
psPage object
psPage.Redirect ( string destination, PSArgClass argument )
Argument |
Description |
---|---|
destination |
This must be a URL. |
argument |
If you do not use null for this value, you must construct an object with PSArgClass and call the addArg method on that object to add parameter names and values. |
None
You define the parameters that you pass in the PSArgClass object. The Redirect method calls the GetParameterString method on the PSArgClass object to return a URL-encoded string.
If a redirect is done before HTML generation starts, HTML generation will not occur but will still trigger the RequestFinish event. If called in or after the BeforeGenerate event, generation will complete, but the generated page will not be sent to the client browser.
If Redirect is called more than once, earlier calls to this method are overwritten. Only the last call will have any effect.
This example uses the Redirect method with parameters, where “param1” is a parameter defined on the Parameters tab of the Page Properties dialog box:
PSArgClass myParam=null;
myParam = new PSArgClass();
myParam.addArg("param1", param1);
psPage.Redirect("page_2.jsp", myParam);
Redirects the current request to another URL.
PSDocumentClass object
psDocument.Redirect( URL )
Argument |
Description |
---|---|
URL |
The URL to which the current request is being directed |
None.
At runtime, Redirect has the following behavior:
Application server |
Runtime behavior |
---|---|
ASP |
Sets the value of the redirect property of the document object |
JSP |
Calls the sendRedirect method on the response object |
The following example redirects the current request to the Sybase Web site:
psDocument.Redirect("http://www.sybase.com");