473,513 Members | 2,430 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

error from RangeValidator

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
Nov 19 '05 #1
3 2408
"=?Utf-8?B?ZGF2aWQ=?=" <da***@discussions.microsoft.com> wrote in
news:9D**********************************@microsof t.com:
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.

--
Hope this helps.

Chris.
-------------
C.R. Timmons Consulting, Inc.
http://www.crtimmonsinc.com/
Nov 19 '05 #2
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

"Chris R. Timmons" wrote:
"=?Utf-8?B?ZGF2aWQ=?=" <da***@discussions.microsoft.com> wrote in
news:9D**********************************@microsof t.com:
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.

--
Hope this helps.

Chris.
-------------
C.R. Timmons Consulting, Inc.
http://www.crtimmonsinc.com/

Nov 19 '05 #3
"=?Utf-8?B?ZGF2aWQ=?=" <da***@discussions.microsoft.com> wrote in
news:C2**********************************@microsof t.com:
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).

--
Hope this helps.

Chris.
-------------
C.R. Timmons Consulting, Inc.
http://www.crtimmonsinc.com/
Nov 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
2118
by: Roman | last post by:
I'm trying to create the form which would allow data entry to the Client table, as well as modification and deletion of existing data rows. For some reason the DataGrid part of functionality stops...
2
1722
by: D. Shane Fowlkes | last post by:
This seems simple enough but why can't I get it to check the input BETWEEN the two ranges I specify? If I set the Min value to 1 and the Max to 10, it will ONLY validate 1 OR 10....not 2 thru 9. ...
2
4374
by: Lucas Tam | last post by:
Hi all, I have a RangeValidator that is not working correctly - it is always returning a isValid = False. The Javascript is returning this as well as on the server side. My RangeValidator...
1
1276
by: ad | last post by:
I use RangeValidator to validate a textbox from 1 to 5 But if the user left the TextBox empty, the RangeValidator take no action. Can RangeValidator Chek emtpy value?
1
1517
by: COHENMARVIN | last post by:
I'm trying to get a rangevalidator to work. Normally this is easy, but here I'm trying to make the rangevalidator check a range that is from variables. Here is the code. Its simple, but it...
4
1496
by: jiznena | last post by:
i wanna use RangeValidator but it always returns false,even i give the right numbers <asp:RangeValidator ID="RangeValidator1" runat="server" ControlToValidate="TextBox1" ...
1
2234
by: Cirene | last post by:
Here's my RangeValidator <asp:RangeValidator ID="RangeValidator1" runat="server" ControlToValidate="txtSVDV" ErrorMessage="RangeValidator" MaximumValue="0" MinimumValue="-100" Type="Double">Make...
0
1252
by: Andrew Han | last post by:
I have a simple textbox where a user can enter a numeric value. The RangeValidator works perfectly well to determine if the value is a number of whatever type I specify AND to determine if the...
1
2114
by: Cirene | last post by:
I have a rangevalidator as follows... <asp:RangeValidator ID="RangeValidator4" runat="server" ControlToValidate="InvoicePriceTextBox" ErrorMessage="0-999999" MaximumValue="999999"...
0
7265
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7171
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7545
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7111
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7539
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5095
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3240
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3228
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
461
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.