[ASP.NET] 使用Tab不停留在物件上

1 mins.

這個功能很單純,只是希望按Tab鍵的時候
能夠跳過某些物件,按照希望的順序來切換

不停留TabIndex = -1,其他順序TabIndex=1,2…

1
2
3
4
5
6
<!-- Tab停留 -->
<asp:textbox id="ttbUser" runat="server" tabindex="1">
</asp:textbox>
<!-- Tab不停留 -->
<asp:textbox id="ttbUserName" runat="server" tabindex="-1">
</asp:textbox>