Click here to Skip to main content
15,900,378 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
In ASP .NET when I press the Tab on the last control of a form then cursor goes to the address bar. But I want cursor will focus on other control.
I use textbox.focus() to focus control. But where should I use this code or is this code applicable for asp.net? Please help me.
Posted
Comments
King Fisher 22-Feb-14 1:52am    
"I press the Tab on the last control "

whats Your Last control?
Sumon562 22-Feb-14 5:04am    
TextBox is the last Control
King Fisher 22-Feb-14 5:19am    
use tabindex at pageload

Use TabIndex property of Controls.

see this:
http://msdn.microsoft.com/en-us/library/ms178231.aspx[^]
 
Share this answer
 
XML
<pre lang="cs">protected void Page_Load(object sender, EventArgs e)
  {
      if (!IsPostBack)
      {
          txtbox1.TabIndex = 1;
          txtbox2.TabIndex = 2;
          txtbox3.TabIndex = 3;
//add your controls here
      }
  }</pre>
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900