Trying to create a try...catch loop to validate if the value in a textbox is greater than 0. Not sure how to write it. Can someone give me a good example and explain why it is done that way?
Do not use Try Catch to test a textbox value. A try catch should only be used for situations that you can't predict and or correct programmatically. You need to use a validation tool or just check the text with the IsNumber function and > 0 then reload the page with a label indicating error if not. I will post more if this isn't clear to you but look into Validation tools. I think that's your best approach. However; I do not know if there are validation tools pre-built to test what you want. You may have to do a little customization or just postback the page and check the value in code on the server side.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.