|
Events are pieces of ASP.NET code that executed before or after
record was added, edited, deleted, when new users registers etc.
Typical events send an email with old or new data record, save data
in another table, check record uniqueness, show related to current
record info.
Typical parameters passed to events
e -
OleDbParameterCollection.
Each field on the Add/Edit form represented as 'Field
type'-'Field value' pair
Example of usage:
-
|
VB.NET
Page.Response.Write("Field1 - "+
e["Field1"].ToString())
|
Where - WHERE clause
that points to current record to be edited or deleted
Example of usage:
-
|
VB.NET
Dim sSQLSelect As String = "select * from
[Order details] where " & where
Dim cn As New OleDbConnection(func.GetConnectionStr())
Dim cmdSelect As OleDbCommand = New OleDbCommand(sSQLSelect,
cn)
cmdSelect.CommandType = CommandType.Text
...
|
ASPRunner.NET comes with set of handy predefined code snippets
that you can use in Events.
Sample code
snippets
Send simple email
Send email with new
data
Save new data in
another table
Insert a record
into another table
Check if specific
record exist
Display a
message on the WEB page
Redirect to another
page
Custom code
Here are some real
life events
Show list of customer
orders
Check
if start date is ealier than end date
Before
deleting a record check if related records exist
Speed up data
entry using events
|