so what's the trick to making 'defaultfocus' work?

C

Chris Marsh

I am expecting it to automatically put the cursor in the field I am entering
but it doesn't I still have to tab to get to that field. I was hoping that
I could set the focus, buttons and tab orders just like a regular Windows
form in my web page.

Thank you in advance!
 
G

Guest

Hello Chris,

In Page_Load you can call the Focus() method on the control to set the
default focus:

protected void Page_Load(object sender, EventArgs e)
{
Button1.Focus();
}

To reorder the tab order you should be able to use the TabIndex property.
 

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
474,432
Messages
2,571,682
Members
48,796
Latest member
Greg L.

Latest Threads

Top