Groups | Blog | Home
all groups > asp.net > august 2006 >

asp.net : so what's the trick to making 'defaultfocus' work?



brians[MCSD]
8/16/2006 9:06:02 PM
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.

--
enjoy- brians
http://www.limbertech.com


[quoted text, click to view]
Chris Marsh
8/16/2006 9:08:19 PM
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!

AddThis Social Bookmark Button