Author: stephencrocker | Posted on: 7/26/2009 9:37:59 AM | Views : 854

I would like to know if its possible to do a RegularExpression validation with a session variable.  Here is what I need.  I have a Session Variable called (NumberofVotes)  I would like to be able to use this with a regular expression validator that will look at this session variable and make sure that the number does not exceed the session variable  it can be equal to that number but not exceed it.


Here is my current Validator to make sure that the textbox is filled with numbers only and not exceed 3 digits in length.
<asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ErrorMessage="Only Numbers are Allowed" ControlToValidate="txtPresvotes" ValidationExpression="^([0-9]|[0-9][0-9]\d|999)$"></asp:RegularExpressionValidator>


Thanks for the help in advanced.
Stephen

...

Go to the complete details ...