TabIndex

Discussion in 'ASP .Net' started by Jarod_24, Apr 10, 2004.

  1. Jarod_24

    Jarod_24 Guest

    How does tabindex work in ASP .net pages
    I dosen't seem to work quite like in regular forms. and there isn't any TabStop property either.

    1 .How do you prevent a control form beign "tabbed". (hidden textboxes ect.)

    2. How do get a control to get focus when the page is loaded (think username textfield on a loginpage)

    3. Does the tab-order work just like in regular forms (1 ->2 -> 3 and so on?)

    4. How does tabindex work with datagrid and datalists. (does it focus the whole grid/list and then each control?)

    5. How do you set a buttons to work as the default button (when "Enter" is pressend) or the cancel-button (when "Esc" is pressed)
    Jarod_24, Apr 10, 2004
    #1
    1. Advertising

  2. Jarod_24

    jm Guest

    "Jarod_24" <> wrote in message
    news:...
    > How does tabindex work in ASP .net pages
    > I dosen't seem to work quite like in regular forms. and there isn't any

    TabStop property either.
    >
    > 1 .How do you prevent a control form beign "tabbed". (hidden textboxes

    ect.)
    http://msdn.microsoft.com/library/d...uthor/dhtml/reference/properties/tabindex.asp
    1.. Objects with a negative tabIndex are omitted from the tabbing order.
    also see:

    http://msdn.microsoft.com/library/d...ystemwindowsformscontrolclasstabstoptopic.asp



    > 2. How do get a control to get focus when the page is loaded (think

    username textfield on a loginpage)

    http://www.ondotnet.com/pub/a/dotnet/2003/09/15/aspnet.html

    "Private Sub SetFocus(ByVal ctrl As Control)
    ' Define the JavaScript function for the specified control.
    Dim focusScript As String = "<script language='javascript'>" & _
    "document.getElementById('" + ctrl.ClientID & _
    "').focus();</script>"

    ' Add the JavaScript code to the page.
    Page.RegisterStartupScript("FocusScript", focusScript)
    End Sub

    You can now call the custom SetFocus() function from any event handler to
    change the control focus as needed:


    SetFocus(myTextBox);
    Remember, the focus change won't take effect until the page is rendered and
    sent back to the browser."


    >
    > 3. Does the tab-order work just like in regular forms (1 ->2 -> 3 and so

    on?)

    It always has for me.


    >
    > 4. How does tabindex work with datagrid and datalists. (does it focus the

    whole grid/list and then each control?)


    http://msdn.microsoft.com/library/d...ystemwindowsformscontrolclasstabstoptopic.asp

    see if that helps.


    > 5. How do you set a buttons to work as the default button (when "Enter" is

    pressend) or the cancel-button (when "Esc" is pressed)
    >

    It looks like you are asking two different questions here. As to the first,

    http://www.allasp.net/enterkey.aspx

    http://216.239.41.104/search?q=cach...870 asp.net set default button&hl=en&ie=UTF-8

    http://www.google.com/search?sourceid=navclient&ie=UTF-8&oe=UTF-8&q=asp.net set default button

    on your second, it looks like you want client side code, I would look at
    onkeypress calling Javascript and using keycode:

    http://www.google.com/search?num=100&hl=en&lr=&ie=UTF-8&oe=UTF-8&q=javascript keycode

    Hope this helps.


    ---

    Checked by AVG anti-virus system (http://www.grisoft.com).
    Version: 6.0.655 / Virus Database: 420 - Release Date: 4/8/2004
    jm, Apr 10, 2004
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ravikanth[MVP]

    TabIndex of DataGrids

    Ravikanth[MVP], Jul 18, 2003, in forum: ASP .Net
    Replies:
    2
    Views:
    332
    Deidre
    Jul 21, 2003
  2. kai

    Tabindex

    kai, Jan 9, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    3,991
  3. Natty Gur
    Replies:
    1
    Views:
    1,873
    Marshal Antony
    Mar 3, 2004
  4. Jarod_24

    how does TabIndex work?

    Jarod_24, Apr 5, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    729
    Jarod_24
    Apr 5, 2004
  5. niv

    tabindex on webform

    niv, Oct 17, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    348
Loading...

Share This Page