Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > TabIndex

Reply
Thread Tools

TabIndex

 
 
Jarod_24
Guest
Posts: n/a
 
      04-10-2004
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)



 
Reply With Quote
 
 
 
 
jm
Guest
Posts: n/a
 
      04-10-2004

"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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
tabindex on webform niv ASP .Net 0 10-17-2004 07:21 PM
how does TabIndex work? Jarod_24 ASP .Net 0 04-05-2004 01:34 PM
Re: TabIndex propery not working as expected for Server controls Natty Gur ASP .Net 1 03-03-2004 04:09 PM
Tabindex kai ASP .Net 2 01-09-2004 02:38 PM
TabIndex of DataGrids Ravikanth[MVP] ASP .Net 2 07-21-2003 04:09 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57