Export (0) Print
Expand All

RangeValidator.MinimumValue Property

Gets or sets the minimum value of the validation range.

Namespace: System.Web.UI.WebControls
Assembly: System.Web (in system.web.dll)

[ThemeableAttribute(false)] 
public string MinimumValue { get; set; }
/** @property */
public String get_MinimumValue ()

/** @property */
public void set_MinimumValue (String value)

public function get MinimumValue () : String

public function set MinimumValue (value : String)

Property Value

The minimum value of the validation range. The default value is String.Empty.

Use the MinimumValue property to specify the minimum value of the validation range. If the value specified by this property fails to convert to the data type specified by the BaseCompareValidator.Type property, an exception is thrown.

NoteNote

If you specify ValidationDataType.Date for the BaseCompareValidator.Type property without programmatically setting the culture for the application, you should use a culture-neutral format, such as YYYY/MM/DD, for the MaximumValue and MinimumValue properties. Otherwise, the date may not be interpreted correctly.

This property cannot be set by themes or style sheet themes. For more information, see ThemeableAttribute and ASP.NET Themes and Skins Overview.

TopicLocation
Walkthrough: Validating User Input in a Web Forms PageBuilding ASP .NET Web Applications in Visual Studio

The following example demonstrates how to use the MinimumValue property to specify the minimum value of the validation range.


<%@ Page Language="C#" AutoEventWireup="True" %>

<html>

<head>

   <script runat="server">

      void ButtonClick(Object sender, EventArgs e)
      {

         if (Page.IsValid)
         {
            Label1.Text="Page is valid.";
         }
         else
         {
            Label1.Text="Page is not valid!!";
         }

      }

   </script>

</head>

<body>

   <form runat="server">

      <h3>RangeValidator Example</h3>

      Enter a number from 1 to 10:

      <br>

      <asp:TextBox id="TextBox1"
           runat="server"/>

      <br>

      <asp:RangeValidator id="Range1"
           ControlToValidate="TextBox1"
           MinimumValue="1"
           MaximumValue="10"
           Type="Integer"
           EnableClientScript="false"
           Text="The value must be from 1 to 10!"
           runat="server"/>

      <br><br>

      <asp:Label id="Label1"
           runat="server"/>

      <br><br>

      <asp:Button id="Button1"
           Text="Submit"
           OnClick="ButtonClick"
           runat="server"/>
            

   </form>

</body>
</html>


Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

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

.NET Framework

Supported in: 2.0, 1.1, 1.0

Community Additions

ADD
Show:
© 2014 Microsoft