Thursday, January 13, 2011
Data Controller URL Parameters

Code On Time applications recognize several URL parameters that allow constructing simple URL actions to open a multiple-purpose page in “new”, “edit” , or “view” mode.

The following URL will start a record in "new" mode.
 
http://dev.codeontime.com/demo/websitefactory1/Pages/Customers.aspx?_controller=Customers&_commandName=New&_commandArgument=createForm1

image
 
The following URL will start the Products page with product #7 displayed in "edit" mode.
 
http://dev.codeontime.com/demo/WebSiteFactory1/Pages/Products.aspx?ProductID=7&_controller=Products&_commandName=Edit&_commandArgument=editForm1

image
 
The following URL will select a Product record with ID = 35 in "view" mode:

http://dev.codeontime.com/demo/WebSiteFactory1/Pages/Products.aspx?ProductID=35&_controller=Products&_commandName=Select&_commandArgument=editForm1

image

The “_controller” parameter is optional if your page presents a single data controller. You have to use this parameter to ensure that master-detail pages will respond correctly. The following URL will navigate to the protected Suppliers page and will select supplier #22 in “edit” mode. You will have to sign in to access the page.

http://dev.codeontime.com/demo/WebSiteFactory6/Pages/Suppliers.aspx?SupplierID=22&_controller=Suppliers&_commandName=Edit&_commandArgument=editForm1

image

Notice that cancellation or successful Insert, Update, or Delete action will automatically navigate back to the previous page that was loaded in the browser prior to navigation with data controller URL parameters. This convenient behavior will save time that is typically needed to write redirection logic in similar situations.