hello ,
if it is a windows form the textbox has a focus metod .
If it is a web form
write client script block
below is an example
<%@ Page Language="vb" AutoEventWireup="false" Codebehind="WebForm1.aspx.vb"
Inherits="ClientSideScriptExample.WebForm1"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<title>WebForm1</title>
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema"
content="
http://schemas.microsoft.com/intellisense/ie5">
<script language="javascript">
function cmdButton1_Clicked()
{ document.all('txtInput1').focus();
return false;
}
function cmdButton2_Clicked()
{ document.all('txtInput2').focus();
return false;
}
</script>
</HEAD>
<body MS_POSITIONING="GridLayout">
<form id="Form1" method="post" runat="server">
InputBox 1:
<asp:TextBox ID="txtInput1" Runat="server" Width="50" />
<br>
InputBox 2:
<asp:TextBox ID="txtInput2" Runat="server" Width="50" />
<br>
<br>
Click a button to set focus on the specified control:<br>
<input ID="cmdButton1" type="button" value="InputBox 1"
OnClick="return cmdButton1_Clicked()">
<input ID="cmdButton2" type="button" value="InputBox 2"
OnClick="return cmdButton2_Clicked()">
</form>
</body>
</HTML>
regards
Ansil
Trivandrum