Primary keys, foreign keys, and other field values are easily passed from page to page via URL parameters established
with settings in the Bindings tab of the Properties dialog. Sometimes, however, you may need to pass non-databound values and other calculated values via URL parameters.
This can be done by overriding the Save button click handler method on the record page.
This example shows how to redirect to some other page after updating or creating new record in a page.
the user is redirected to some other page instead of the normal (default) behavior of going back to the previous page. To do this,
we override the SaveButton_Click() button click event handler method in the Page class in aspx.cs code-behind file.
For a Web Application the customization will be added in:
..\<Application Name>\<Table Name>\Add<Table Name>.Controls.cs
For example: C:\MyApp1\Orders\AddOrders.Controls.cs
For a Web Site the customization will be added in:
..\<Application Name>\App_Code\<Table Name>\Add<Table Name>.Controls.cs
For example: C:\MyApp1\App_Code\Orders\AddOrders.Controls.cs
This customization will be executed when the "Save" button, which updates a record, is clicked, so this customization can also be done on the edit page.
|