Hi,
Within an e-commerce website, the cart summary page allows customers to
change the quantities of ordered items. Within this page I want to add the
following restrictions :
* Restrict the value e.g. > 0 and < 10 ?
* Stop negative values
* Stop non-numeric characters.
I've used the following code (asp.net 1.1,
vb.net 2003) to restrict the
first two, which works fine :
Code:
If (intQuantity <=0 OR intQuantity >10) Then
intQuantity references a textbox that the customer can edit the quantity of
the item they have selected. However to stop non-numeric characters I
thought of using the "IsNumeric" function. What I want to say is if the
value inputted is non-numeric thenxxxx. So I used the following code :
Code:
If (IsNumeric <> (txtQuantity.Text)) OR (intQuantity <=0 OR
intQuantity >10) Then
which then results in an error :
Compilation Error
Description: An error occurred during the compilation of a resource
required to service this request. Please review the following specific
error details and modify your source code appropriately.
Compiler Error Message: BC30455: Argument not specified for parameter
'Expression' of 'Public Function IsNumeric(Expression As Object) As
Boolean'.
Source Error:
Line 205:
Line 206: Line 207: If (IsNumeric <> (txtQuantity.Text))
OR (intQuantity <=0 OR intQuantity >10) Then
Line 208: Line 209: 'Display message advising item
is low in stock
Any ideas on how I can overcome this ?
Thanks,