Sunday, November 12, 2006

Set Focus on Login Control Asp.net 2.0

Hi Folks,

to set focus on login control on username text box what you need to do,switch to HTML of your page and paster the folwing on form tag :


defaultfocus="Login1_UserName" />

happy .netting :)

Regards,
Moustafa arafa

10 comments:

  1. u have been a great sort of help.. thanks heaps..

    ReplyDelete
  2. You rock the doodle

    ReplyDelete
  3. Thanks, and how to set focus on username again when login failed?

    ReplyDelete
  4. Thanks bud. Well handy.

    ReplyDelete
  5. Great article!!!!!!!

    ReplyDelete
  6. Sorry, man this doesn't work!! Any idea?

    ReplyDelete
  7. If you would like to do it server side

    Login1.FindControl("UserName").Focus();

    "Login1" being the ID of the login control

    ReplyDelete
  8. Simple & Effective - much obliged.

    ReplyDelete
  9. This is great, I never realized before the cost of clicking the textboxes prior to login.

    ReplyDelete
  10. Thank you and Kumu. Your solution is great!

    ReplyDelete

Note: Only a member of this blog may post a comment.