In Javascript,-
<script language="javascript" type="text/javascript">
function CheckTextLength(text, long) {
var maxlength = new Number(long);
if (text.value.length > maxlength) {
text.value = text.value.substring(0, maxlength);
alert(" Only " + long + " characters allowed");
}
}
</script>
In Aspx page ,-
<asp:TextBox runat="server" ID="txtAdmissionDate" Width="450px" TextMode="MultiLine"
onKeyUp="CheckTextLength(this,10)" onChange="CheckTextLength(this,10)"></asp:TextBox>