error from RangeValidator

G

Guest

I implemented RangeValidator for UserID as follows:
Type: string
Minimum Value: 4
Maximum Value: 16
==================
After compilation, I access to the web page for login and get the following
message:
Server Error in '/Demo' Application.
--------------------------------------------------------------------------------

The MaximumValue 16 cannot be less than the MinimumValue 4 of
RangeValidatorUserID.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information about
the error and where it originated in the code.

Exception Details: System.Web.HttpException: The MaximumValue 16 cannot be
less than the MinimumValue 4 of RangeValidatorUserID.
====================

The web page layout is GridLayout.

Need your help.

Thanks

David
 
C

Chris R. Timmons

I implemented RangeValidator for UserID as follows:
Type: string
Minimum Value: 4
Maximum Value: 16
==================
After compilation, I access to the web page for login and get
the following message:
Server Error in '/Demo' Application.
-----------------------------------------------------------------
---------------

The MaximumValue 16 cannot be less than the MinimumValue 4 of
RangeValidatorUserID.
Description: An unhandled exception occurred during the
execution of the current web request. Please review the stack
trace for more information about the error and where it
originated in the code.

Exception Details: System.Web.HttpException: The MaximumValue 16
cannot be less than the MinimumValue 4 of RangeValidatorUserID.

David,

When comparing strings, 16 is less than 4, because the character "1"
has a lower value than the character "4".

Change the RangeValidator's type to integer.
 
G

Guest

Thank you, Chris.
(1) I just open the page without a chance for any input, and got the error
message.
(2) When I read the book, it said the Minimum Value for string Type
specifies the minimum character length of the string. So the setup of
property of RangeValidator should be correct.

What is wrong with it? Could you explain it specific? Thank you.

David
 
C

Chris R. Timmons

Thank you, Chris.
(1) I just open the page without a chance for any input, and got
the error message.
(2) When I read the book, it said the Minimum Value for string
Type specifies the minimum character length of the string. So
the setup of property of RangeValidator should be correct.

What is wrong with it? Could you explain it specific? Thank you.

David,

What book did you see that in?

The RangeValidator only checks to see if a value is within a given
range (e.g. if "B" is between "A" and "M" when Type is set to
string).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top