On your textbox, add an
onkeypress JavaScript event and run a method in there:
<script type="text/javascript">
var maxLength = 100;
function CheckLength(textbox) {
if(textbox.value.length >= maxLength) {
document.getElementById("<%=textbox2.ClientID%>").focus();
textbox.value = textbox.value.substring(0, maxLength);
}
}
</script>
<asp:textbox id="textbox1" runat="server" onkeypress="CheckLength() />
<asp:textbox id="textbox2" runat="server" />