CodeCharge Studio | All ASP PHP Perl ColdFusion Java C#.NET VB.NET |
This example shows how to redirect the user to different pages after the Insert or Update operation is performed. In this case, we have a Record form which has an Insert button named Insert1 and an update button named Update1. We add code in the On Click event of each of the buttons to perform the redirection:
Note: The Redirect variable can be modified in the onClick event of the Button only if the Return Page property of this Button is empty, otherwise Redirect will be overwritten in page's code.
Function Form1_Insert1_OnClick(Sender) { Redirect = "InsertMessagePage.asp" } Function Form1_Update1_OnClick(Sender) { Redirect = "UpdateMessagePage.asp" }
function Form1_Insert1_OnClick(& $sender) { global $Redirect; $Redirect = "InsertMessagePage.php"; } function Form1_Update1_OnClick(& $sender) { global $Redirect; $Redirect = "UpdateMessagePage.php"; }
sub Form1_Insert1_OnClick() { $Redirect = "InsertMessagePage.php"; } sub Form1_Update1_OnClick() { $Redirect = "UpdateMessagePage.php"; }
<!---Form1_Insert1_OnClick ---> <CFSET strRedirect = "InsertMessagePage.cfm">
<!---Form1_Update1_OnClick ---> <CFSET strRedirect = "UpdateMessagePage.cfm">
'Form1_Insert1_OnClick RedirectUrl = "InsertMessagePage.aspx"
'Form1_Update1_OnClick RedirectUrl = "UpdateMessagePage.aspx"
//Form1_Insert1_OnClick RedirectUrl = "InsertMessagePage.aspx";
//Form1_Update1_OnClick RedirectUrl = "UpdateMessagePage.aspx";
//Form1_Insert1_OnClick e.getPage().setRedirectString("InsertMessagePage.do");
//Form1_Update1_OnClick e.getPage().setRedirectString("UpdateMessagePage.do");