在c#.net中回发后维护tabindex [英] maintain tabindex after postback in c#.net

查看:113
本文介绍了在c#.net中回发后维护tabindex的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

<td>
 <asp:DropDownList ID="ddlcountry" runat="server" AutoPostBack="true" TabIndex="1" OnSelectedIndexChanged="ddlcountry_SelectedIndexChanged">
  <asp:ListItem Text="--Select--" Value="0"></asp:ListItem>
  </asp:DropDownList>
  </td>




<td><asp:DropDownList ID="ddlstate" Width="110px" TabIndex="2" runat="server"                                   AutoPostBack="true" OnSelectedIndexChanged="ddlstate_SelectedIndexChanged">
  <asp:ListItem Text="--Select--" Value="0"></asp:ListItem>
 </asp:DropDownList>




<td>
 <asp:DropDownList ID="ddldistricts" runat="server" TabIndex="3">
  <asp:ListItem Value="0" Text="--Select--"></asp:ListItem>
 </asp:DropDownList>
 </td>





正如我提到的三个下拉列表,通过选择一个下拉列表,另一个下拉列表需要绑定。因此,我保持autopostback属性为true。在选择第一个下拉列表光标后,我需要保持tabindex需要移动下一个下拉列表。我怎么能得到请帮助我。



As i mentioned three dropdown lists,By selecting one dropdownlist another dropdownlist need to bind. so for that i kept autopostback property to true.Here I need to maintain tabindex after selecting 1st dropdown list cursor need to move the next dropdown list.How can i get Please help me.

推荐答案

您只需将焦点设置为SelectedIndexChanged处理程序中所需的组合框。



You simply need to set focus to the combobox needed in your SelectedIndexChanged handler.

ddlstate.Focus();





在ddlstate处理程序中设置



And in the ddlstate handler you set

ddldistricts.Focus();







如果这有帮助请花时间接受解决方案。谢谢。




If this helps please take time to accept the solution. Thank you.


这篇关于在c#.net中回发后维护tabindex的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆