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:

Unknown said...

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

Anonymous said...

You rock the doodle

Anonymous said...

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

Anonymous said...

Thanks bud. Well handy.

Anonymous said...

Great article!!!!!!!

Anonymous said...

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

Anonymous said...

If you would like to do it server side

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

"Login1" being the ID of the login control

Anonymous said...

Simple & Effective - much obliged.

Talha said...

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

Anonymous said...

Thank you and Kumu. Your solution is great!