Trouble with Range Validator

I have a range field validator that checks a quantity textbox for a product before its added to a shopping cart to be between 1 and 10. It works the first time but when the user trys to add more of the same product and enters any number other than 1, even if its in the range, it gives the error.
LVL 1
ashp87Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

tiagosalgadoCommented:
Can you show some code please? Its better to detect some error.
0
ashp87Author Commented:
this is in the page load, the quantity is required before someone can add a item to the cart:
    Protected Sub btnYes_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnYes.Click
        objDT = Session("Cart")
        Dim Product = lbResults.SelectedItem.Text
        Dim blnMatch As Boolean = False

        For Each Me.objDR In objDT.Rows
            If objDR("Product") = lbResults.SelectedItem.Text Then
                objDR("Quantity") += txtQuantity.Text
                blnMatch = True
                Exit For
            End If
        Next

        If Not blnMatch Then
            objDR = objDT.NewRow
            objDR("Quantity") = txtQuantity.Text
            objDR("Product") = Product
            objDR("Cost") = Decimal.Parse(20)
            objDT.Rows.Add(objDR)
        End If
        Session("Cart") = objDT

        dg.DataSource = objDT
        dg.DataBind()

        Session("Total") = GetItemTotal()
        lblTotal.Text = "$" & GetItemTotal()
    End Sub
0
ashp87Author Commented:
i made a mistake on the post above its not in the page load, i changed teh code i was pasting and i forgot to delete that comment
0
CompTIA Network+

Prepare for the CompTIA Network+ exam by learning how to troubleshoot, configure, and manage both wired and wireless networks.

ashp87Author Commented:
apparently, it doesnt matter what happens, the first time I click add to cart, the next time i try to add to cart, even if the value is in range, it will come up saying its not in range.
0
Obadiah ChristopherCommented:
Have u set the datatype of the range validator? By default it is string. u will need to change it.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
ashp87Author Commented:
the thing was, in the properties it was set , but when i manually set it in the code, it stopped giving me problems....
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.