I agree with Oliver, who suggests continuing to try to use the validators.
There is no reason why you cannot get a CustomValidator to handle what you
want.
When you state you are calculating a value on the server side and using it
with a RangeValidator, are you using that value as the Minimum or Maximum of
the range? If so, there is no javascript involved. You convert the number to
a string and assign it to one of those properties. The RangeValidator
handles it from there. Just make sure RangeValidator.Type is Integer,
Decimal, or Currency.
Actually I notice that you want the textbox value greater than X. So lets
switch from RangeValidator to CompareValidator. Set the Operator to
GreaterThan and ValueToCompare to the string of the number you calculate.
--- Peter Blum
www.PeterBlum.com
Email:
Creator of "Professional Validation And More" at
http://www.peterblum.com/vam/home.aspx
"COHENMARVIN" <> wrote in message
news: oups.com...
>I have a problem that sounds simple but seems impossible with asp.net.
> I calculate a variable in the Page_Load event, call it X. Then I want
> my range validators to fire when a textbox value is greater than X.
> They should give an error message, both as a messagebox and inline in
> the page. I can't get the range validators to use X. I get syntax
> errors when I try. I tried Custom Validators and got the same problem.
>
> So now I want to try using client side javascript with forms. This may
> not work either, because I calculate X in page_load, and I don't know
> how to communicate X to the javascript. But forget that for now, does
> anybody know how to intercept the SUBMIT click of an asp.net form and
> use client side javascript validation on it?
>