Click to See Complete Forum and Search --> : How can I set focus in a Textbox into a WebUserControl?


see07
May 21st, 2004, 11:20 AM
Hello everybody:
I have a WebUserControl embedded into a Web Form (I’m using C# .net).
When I load Web Form I need to set the cursor into a Textbox that is into WebUserControl.
In <body> of Web Form I have:
<body bgColor=”#ccfff MS_POSITIONING=”GridLayout” onload=”document.WUCDatos.TextBox2.focus(); “>
Where WUCDatos is form id of WebUserControl and TextBox2 is the Text Box into WebUserControl.
But this code doesn’t work.
I’ll appreciate your help.
A.L.

ABudair
May 23rd, 2004, 06:55 AM
Hi,

Try this please.

<body bgColor=”#ccfff MS_POSITIONING=”GridLayout” onload=”document.forms[0].WUCDatos_TextBox2.focus();“>

hope it helps..


bye.

see07
May 24th, 2004, 09:59 AM
Thanks you my Jordan friend, I appreciate so much your help. Finally your answer work very well..