Set the cursor on the first control in the web form

F

Felix_WafyTech

Hi,

I want to set the tab order for the controls in the web form. How do I set
it? Setting the TabIndex doesn't seem to work. I just need the first control
to have the focus when opening the form. Any help is greatly appreciated.

Thanks,
Felix.J
 
B

Bruce Barker

in client script use the focus() method. version 2 of asp.net has a server
side method to emit the client script.

-- bruce (sqlwork.com)
 
S

Steven Cheng[MSFT]

Hi Felix,

As for the ASP.NET webcontrols, they're rendered as raw html elements on
web page when transfered to client browser and not all the html elements
support tab index, some ones like html button or textbox should support
this. Also, as Bruce has mentioned, if you're using ASP.NET 2.0, you can
use the Page.SetFocus method to set focus for a web server control on the
web page.

#Page.SetFocus Method
http://msdn2.microsoft.com/en-us/library/system.web.ui.page.setfocus(VS.80).
aspx

Hope this helps.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,053
Latest member
billing-software

Latest Threads

Top