How may I set the focus to a textbox on my ASP.NET webform ?


E

Eddie

How may I set the focus to a textbox on my ASP.NET webform ?
Probably with Javascript, but I dont know how...

Any exemples ???

Thx
 
Ad

Advertisements

B

BluDog

How may I set the focus to a textbox on my ASP.NET webform ?
Probably with Javascript, but I dont know how...

Are you talking about serverside (i.e. after a postback) or client
side (e.g. after the user has clicked on a button or something that is
handled through clientside scripting)?

Cheers

Blu
 
A

avnrao

write this in code behind..

RegisterStartupScript("Set focus","<script
language='javascript'>document.forms('formname').controlname.focus();</script>");

Av.
 
E

Eddie

I'm talking about Serverside AND clientSide :eek:)

Sometimes I need to set the focus on a textbox after a postback, and
sometimes I need to set the focus on a textbox after a clientsite
validation...

Thx...
 
Ad

Advertisements


Top