Hai Friends,
You dont Have to send control id to move next control, u just assign unique tabindex to the each control on the page,
Put the coding in <Head> tag of asp.net file ,
=================================================
<script language ="javascript" type ="text/javascript" >
function FocusNext(cid)
{
var i=document.getElementById (cid.id).getAttribute ('tabindex');
var iKeyCode = 0;
if (window.event)
iKeyCode = window.event.keyCode
else if (e)
iKeyCode = e.which;
if (iKeyCode == 13)
{
var ctrl=document.all;
for(var count = 0; ctrl.length ; count ++)
{
if(ctrl[count].tabIndex == i+1)
{
ctrl[count].focus();
}
}
}
else
return true;
}
</script>
==================================================================
Add OnKeyPress Event in TextBox
================================
<asp:TextBox ID="TextBox1" runat="server" TabIndex="1" Width="50px" onKeyPress="FocusNext(this)"></asp:TextBox>