Thursday, September 22, 2011

More on the TextBox Counter by SKMControls

I found a free TextBox counter by SKMControls that counts the amount of characters in a multiline asp:TextBox control. This is useful for Asp.NET pages with Note fields where end users tend to write alot but yet you have limits to how many characters the database field will hold.

First add the file skmcontrols2.dll to the bin folder.

In your aspx .NET page, register the control.


<% @ Register Assembly="skmControls2" Namespace="skmControls2" TagPrefix="skm" %>

Next, add your control to the page.

<skm:TextBoxCounter runat="server" ForeColor="GrayText" WarningPercentage="80" MaxCharacterLength="7900" TextBoxControlId="NoteTextBox" ID="TextBoxCounter1"></skm:TextBoxCounter>

The TextBoxControlID property is used to bind the control to the multi-line textbox on your page.