Gaurav Taneja

Great dreams... never even get out of the box. It takes an uncommon amount of guts to put your dreams on the line, to hold them up and say, "How good or how bad am I?" That's where courage comes in.

  Home  |   Contact  |   Syndication    |   Login
  90 Posts | 0 Stories | 78 Comments | 7 Trackbacks

News




Google RankGoogle PRâ„¢ - Post your Page Rank with MyGooglePageRank.com



The content on this site represents my own personal opinions and thoughts at the time of posting, and does not reflect those of my employer's in any way.

Disclaimer:- All postings in this blog is provided "AS IS" with no warranties, and confers no rights.

Archives

Post Categories

Image Galleries

Atlas

Error

OutLook

SharePointService

Usefull Site Links

You need to define which Textbox and Button you want to make them default.

// add the attribute in your form tag

<form id="form1" DefaultButton="Button1" DefaultFocus="TextBox2" runat="server">

  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati
posted on Tuesday, September 05, 2006 9:39 AM

Feedback

# re: Setting Default focus on TextBox & Button for ASP.NET 2.0 9/30/2008 8:48 AM sreevi
nice,very simple,its working fine

# re: Setting Default focus on TextBox & Button for ASP.NET 2.0 1/20/2009 12:47 PM Ron Ehrlich
I treid many attempts to use default focus on my text box and they all fail:
<form id="form1" DefaultFocus="tb2" runat="server">
Please Enter Password:
<asp:TextBox id="tb2" TextMode="password" runat="server" ></asp:TextBox>

Please help. Thanks.

Post A Comment
Title:
Name:
Email:
Website:
Comment:
Verification: