P. 1
RadControls for ASP.NET Ajax

RadControls for ASP.NET Ajax


|Views: 25,631|Likes:
Published by CAP History Library

More info:

Published by: CAP History Library on Jan 07, 2009
Copyright:Attribution Non-commercial Share Alike


Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less






RadControls for ASP.NET AJAX


RadControls for ASP.NET AJAX

Text: "*"

7.Just after the dtpDropoff date picker add a ASP.NET RequiredFieldValidator with the following properties:

ErrorMessage: "Dropoff date required"

ControlToValidate: "dtpDropoff"

ValidationGroup: "CarsGroup"

Text: "*"

8.Add a CustomValidator:

ClientValidationFunction: "CompareCarsDates"

ErrorMessage: "Pickup must be less than dropoff date and time".

ValidationGroup: "CarsGroup"

9.Set the btnCars ValidationGroup property to "CarsGroup".
10.Inside the

tag add the JavaScript below.

The JavaScript method must match the ClientValidationFunction property value in the
CustomValidator. The method takes a sender and event args.  "args" contains an IsValid property that is
set depending on the functions custom critieria. In this case the criteria is that the pickup is less than the
dropoff date and time.

11.Underneath the multi-page add two ValidationSummary controls, the first with ValidationGroup property
"FlightsGroup" and the second with ValidationGroup "CarsGroup".
12.Press Ctl-F5 to run the application.

Date and Time Picker Client API

You can access the date-time picker controls and calendar using the usual $find() method against the
control's ClientID property. As with the date and time picker server-side API, you can also access child controls:

F[JavaScript] CustomValidator Compare Function

You can find the complete source for this project at:

\VS Projects\DateTimeSchedule\DateTime_Validation

Gotcha! If clicking the button doesn't perform the validation, Check that the ValidationGroup
property of both the button that initiates the validaiton, the controls to be validated and the
validation controls themselves. These must all be present and match.

You're Reading a Free Preview

/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->