如何设置第一个中继器项目内第一个输入元素的选项卡索引?

发布于 2024-08-31 09:05:58 字数 257 浏览 4 评论 0原文

我有一个 aspx 表单,其中包含许多单独的控件,例如一个中继器控件。

中继器控制项基本上具有彼此相邻的下拉菜单、文本框等。

我的问题是我可以轻松设置每个单独元素的选项卡索引,但我不知道如何设置第一个中继器项目中第一个元素的选项卡索引。

这就是为什么我首先需要单击该项目,然后中继器控件内的选项卡索引工作正常。

你知道我该如何解决这个问题吗?

我应该在服务器端处理这个问题吗?或 jQuery 等?

谢谢

I have an aspx form containing many individual controls like and one repeater control.

The repeater control items are basically having dropdowns, textboxes etc. next to each other.

My problem is I can set the tab index of each individual element easily but I don't know how to set the tab index of the first element in of the first repeater item.

That is why first I need to click the item and then the Tab index inside the repeater control works fine.

Do you know how can I fix this?

Should I handle this on the server side? or jQuery etc?

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

反差帅 2024-09-07 09:05:58

像这样的东西应该有效。其中与 Container.ItemIndex 相乘的 3 是转发器模板上的控件数量。


<asp:Repeater ID="Repeater1" runat="server">
<ItemTemplate>
    <asp:TextBox ID="TextBox1" runat="server" 
       TabIndex='<%# 1 + (Container.ItemIndex)*3 %>'></asp:TextBox>
    <asp:DropDownList ID="DropDownList1" runat="server" 
       TabIndex='<%# 2 + (Container.ItemIndex)*3 %>'>
    </asp:DropDownList>
    <asp:TextBox ID="TextBox2" runat="server" 
       TabIndex='<%# 3 + (Container.ItemIndex)*3 %>'></asp:TextBox>
</ItemTemplate>
</asp:Repeater>

Something like this should work. Where the 3 that multiplies Container.ItemIndex is the number of controls on the repeater template.


<asp:Repeater ID="Repeater1" runat="server">
<ItemTemplate>
    <asp:TextBox ID="TextBox1" runat="server" 
       TabIndex='<%# 1 + (Container.ItemIndex)*3 %>'></asp:TextBox>
    <asp:DropDownList ID="DropDownList1" runat="server" 
       TabIndex='<%# 2 + (Container.ItemIndex)*3 %>'>
    </asp:DropDownList>
    <asp:TextBox ID="TextBox2" runat="server" 
       TabIndex='<%# 3 + (Container.ItemIndex)*3 %>'></asp:TextBox>
</ItemTemplate>
</asp:Repeater>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文