Hi, can someone to help me to write an regular expression for a number from 1-100.
I need to validate an age field.

Thank you

You can use RangeValidator for your requirement.Try this!

<asp:RangeValidator ID="validateage" runat="server" Type="Integer" ControlToValidate="txtage" MinimumValue="1" 
        MaximumValue="100" ErrorMessage="Your age must be between 1 and 100" Display="Dynamic" ></asp:RangeValidator>

I found it
^[1-9][0-9]?[0-9]?$

Thank you nandhinijp. Your solutin is better then mine.

If its ok, Mark as Solved.

commented: Nice work! +3
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.