"Jarod_24" <> wrote in message
news: s.com...
> 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/de...s/tabindex.asp
1.. Objects with a negative tabIndex are omitted from the tabbing order.
also see:
http://msdn.microsoft.com/library/de...bstoptopic.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...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/de...bstoptopic.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=cache...hl=en&ie=UTF-8
http://www.google.com/search?sourcei...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...script+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