ASP.Net Server control that allows only numbers. Basic formatting for US currency and comma separation are provided
This control was developed due to an odd lack of anything in the open source domain that really fulfilled the requirement for a simple numeric only textbox that handles basic US numeric/currency formatting. There are plenty of tutorials that demo how to almost
get the complete functionality, but nothing that's just simple to include in your project and register on a form.
The control is based on the standard asp.net textbox control so it works with databinding as you'd expect. A sample Visual Studio 2008 Solution with a web application is included for testing.
- Include Assembly with your project
- Register tag for your page ex. <%@ Register Assembly="NumericTextBox" Namespace="LZDollarTextBox" TagPrefix="cc1" %>
- Setup control ex. <cc1:NumericTextBox ID="DIO" ControlWidth="120" runat="server" AllowDecimal="True" Text="1232.2123122" DecimalPlaces="4" CanWrite="True" DollarSign="False"