Here is an approach using JavaScript
Here are the 2 text boxes. The Maxlength property of txtbox1 is set to 4. So after entering 4 characters in this text box the focus will be shifted to textbox txtbox2.
<asp:TextBox ID="txtbox1" runat="server" MaxLength="4"></asp:TextBox>
<asp:TextBox ID="txtbox2" runat="server"></asp:TextBox>
Here is the JavaScript that shifts the focus to textbox txtbox2.
<script type="text/javascript">
function setFocus(MaxLength)
{
var txt1 = document.getElementById('<%= txtbox1.ClientID%>');
var txt2 = document.getElementById('<%= txtbox2.ClientID%>');
if(txt1.value.length == MaxLength)
{
txt2.focus();
}
}
</script>
In your code behind file call the javascript function in page_Load.
txtbox1.Attributes.Add("onkeyup", "setFocus(" + txtbox1.MaxLength +")");