|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
set focus to webcontrol on usercontrol in ASP.NET
I'm developing an webapplication with ASP.NET.
On the login page I would like to set the focus on the username textbox. I have tried to use the javascript code like document.formname.textboxname.focus();. This works when the textbox stands on the page. But my textbox stands on a user control that stands on the page. When I try the code document.formname.usercontrolname.textboxname.focus();, it does not work. I don't get an error on the page. Can somebody tell me what I do wrong or give an other solution? Thank you Anneke |
|
#2
|
|||
|
|||
|
.NET generate an ID like UserControlName_TextBoxName
try: document.formname.usercontrolname_textboxname.focus() |
|
#3
|
|||
|
|||
|
Your suggestion works.
Thank you for your help. Anneke |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > .Net Development > set focus to webcontrol on usercontrol in ASP.NET |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|