So I have found how to limit textbox entry to simply numbers using the following:

<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<asp:RegularExpressionValidator ID="RegularExpressionValidator1" ControlToValidate="TextBox1" runat="server" ErrorMessage="Only Numbers allowed" ValidationExpression="\d+"></asp:RegularExpressionValidator>

However, I want to also allow decimals, but only halves (i.e. allow 2.5 and 2, but not 2.3). How could I modify this regex to do this? Or is there another, better way?

Related posts

Recent Viewed