Contents

Introduction
Welcome
System requirements
Licensing details
What is the registration
Using ASPRunner.NET
Working with projects
Connecting to the database
Datasource tables
Master-detail
Choose pages
Login page
User login settings
Avanced Security Settings
User group permissions
Fields order and totals
Miscellaneous settings
Choose theme
Visual Editor
About
Toolbars
Page Elements
"View as" settings
"Edit as" settings
Validation types
Lookup wizard
Events
Output directory settings
After you done
FTP upload
FrontPage Publishing
Advanced topics
Master-details relationship
AJAX-based Functionality
Connecting to database
Connecting to MS Access database
Connecting to MS SQL Server database
Connecting to MySQL database
Connecting to Oracle database
Publishing ASP.NET application to the remote Web server
Using FTP client to publish ASP.NET pages to the remote Web server
Using FrontPage to publish ASP.NET pages to the remote Web server
Demo Account
What is the Demo Account
Terms and conditions
Events
More about events
Predefined actions
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
Sample code
Show list of customer orders
Before deleting a record check if related record exist
Check if start date is earlier then end date
Speed up data entry using events
Order ASPRunner.NET online

 
Home
ASPRunner.NET 5.0 manual
Prev Page Next Page
 
 

Check if start date is earlier then end date

 

On Edit page check if start date is ealier than end date. (Framework 1.1, VB.NET)

C#

public static bool BeforeEdit(System.Web.UI.Page Page, IDictionary e)

{

  string strOrderDate = (string)e["OrderDate"];

  string strRequiredDate = (string)e["RequiredDate"];

  if (!string.IsNullOrEmpty(strOrderDate) && !string.IsNullOrEmpty(strRequiredDate))

  {

  DateTime orderDate = DateTime.Parse(strOrderDate);

  DateTime requiredDate = DateTime.Parse(strRequiredDate);

  if (orderDate > requiredDate)

  {

  Page.Response.Write("<br>Error: OrderDate is more that RequiredDate");

  return false;

  }

  return true;

  }

  //return true if you like to proceed with saving record

  //return false in other case

  return false;

} // BeforeEdit

 

Converted from CHM to HTML with chm2web Standard 2.83 (unicode)