Export (0) Print
Expand All

RangeValidator Class

Validates that another control's value falls within an allowable range.

Namespace:  System.Web.UI.MobileControls
Assembly:  System.Web.Mobile (in System.Web.Mobile.dll)

public class RangeValidator extends BaseValidator
<mobile:RangeValidator />

The minimum and maximum values of the range are provided either directly or by reference to another control. This class behaves identically to the System.Web.UI.WebControls.RangeValidator control.

By default, Command controls on a form raise validator controls on the form to perform validation when the form is submitted to the server. To disable automatic validation, set the CausesValidation property on the Command to false.

The following code example demonstrates how to use the MinimumValue property to validate a numerical value entered into a TextBox.

NoteNote:

The following code sample uses the single-file code model and may not work correctly if copied directly into a code-behind file. This code sample must be copied into an empty text file that has an .aspx extension. For more information, see ASP.NET Web Page Code Model.

Security noteSecurity Note:

This example has a text box that accepts user input, which is a potential security threat. By default, ASP.NET Web pages validate that user input does not include script or HTML elements. For more information, see Script Exploits Overview.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0, 2.0, 1.1

Community Additions

ADD
Show:
© 2014 Microsoft