Custom Row Inserted Add Success Messages for related tables

Tips submitted by ASPMaker users

Custom Row Inserted Add Success Messages for related tables

Postby xgis » Fri Apr 05, 2013 5:01 am

The basic success message from the samples shows how to display the new ID on ADD, using the Row Inserted event;

Page.SuccessMessage = "The unique ID number is " & rsnew("ID")

To change the success message to display the name and the number the following modification be applied;

Page.SuccessMessage = "The unique ID number for " & rsnew("Name") & " is " & rsnew("ID")

The above sample works for the primary table, but to get it display in Foreign Key related tables the following example will get the name for the row from the parent table;

Name = ew_ExecuteScalar("SELECT <FieldName> FROM <ParentTable> WHERE ID = " & ID.CurrentValue)
Page.SuccessMessage = "The unique number for the " & Name & " is " & rsnew("ChildID")
xgis
 
Posts: 87
Joined: Thu Jan 17, 2013 10:40 pm

Return to User Submitted Tips (ASPMaker)