Html @是否为每个复选框设置选项卡索引?
第三方组件: 我有这些强类型的复选框列表,我只想设置它们的选项卡索引。我该怎么做Html @是否为每个复选框设置选项卡索引?,html,asp.net-mvc,asp.net-mvc-4,razor,strongly-typed-view,Html,Asp.net Mvc,Asp.net Mvc 4,Razor,Strongly Typed View,第三方组件: 我有这些强类型的复选框列表,我只想设置它们的选项卡索引。我该怎么做 @Html.CheckBoxListFor(model=>model.agentTypeViewModel.PostedAgentTypes.AgentTypeId, model=>model.agentTypeViewModel.AvailableAgentTypes,
@Html.CheckBoxListFor(model=>model.agentTypeViewModel.PostedAgentTypes.AgentTypeId,
model=>model.agentTypeViewModel.AvailableAgentTypes,
agent=>agent.Id,
agent=>agent.Name,
model=>model.agentTypeViewModel.SelectedAgentTypes,
Position.Vertical)
我成功地设置了我的其他控件选项卡索引,@Html.TextBoxFor(p=>p.TRU,new{tabindex=28,id=“txtru”})
工作正常;但显然,如果我没有为复选框设置选项卡索引,按tab键将直接将光标移动到复选框列表,完全忽略所有其他26个最先出现的字段
有什么建议吗?看起来您正在使用MvcCheckBoxList组件。根据文档(不确定您为什么不读这篇文章): 你可以这样做:
@Html.CheckBoxListFor(model => model.agentTypeViewModel.PostedAgentTypes.AgentTypeId,
model => model.agentTypeViewModel.AvailableAgentTypes,
agent => agent.Id,
agent => agent.Name,
model => model.agentTypeViewModel.SelectedAgentTypes,
Position.Vertical,
x => new {tabindex = 28})
看起来您正在使用MvcCheckBoxList组件。根据文档(不确定您为什么不读这篇文章): 你可以这样做:
@Html.CheckBoxListFor(model => model.agentTypeViewModel.PostedAgentTypes.AgentTypeId,
model => model.agentTypeViewModel.AvailableAgentTypes,
agent => agent.Id,
agent => agent.Name,
model => model.agentTypeViewModel.SelectedAgentTypes,
Position.Vertical,
x => new {tabindex = 28})
看起来您正在使用MvcCheckBoxList组件。根据文档(不确定您为什么不读这篇文章): 你可以这样做:
@Html.CheckBoxListFor(model => model.agentTypeViewModel.PostedAgentTypes.AgentTypeId,
model => model.agentTypeViewModel.AvailableAgentTypes,
agent => agent.Id,
agent => agent.Name,
model => model.agentTypeViewModel.SelectedAgentTypes,
Position.Vertical,
x => new {tabindex = 28})
看起来您正在使用MvcCheckBoxList组件。根据文档(不确定您为什么不读这篇文章): 你可以这样做:
@Html.CheckBoxListFor(model => model.agentTypeViewModel.PostedAgentTypes.AgentTypeId,
model => model.agentTypeViewModel.AvailableAgentTypes,
agent => agent.Id,
agent => agent.Name,
model => model.agentTypeViewModel.SelectedAgentTypes,
Position.Vertical,
x => new {tabindex = 28})
ASP.NET MVC中没有CheckBoxList或CheckBoxListFor,因此您必须使用第三方组件。。如果不知道你具体在用什么,那就很难弄清楚了。@Erik你的权利,完全忘了我在用第三方。我会更新我的问题。感谢ASP.NET MVC中没有复选框列表或复选框列表,因此您必须使用第三方组件。。如果不知道你具体在用什么,那就很难弄清楚了。@Erik你的权利,完全忘了我在用第三方。我会更新我的问题。感谢ASP.NET MVC中没有复选框列表或复选框列表,因此您必须使用第三方组件。。如果不知道你具体在用什么,那就很难弄清楚了。@Erik你的权利,完全忘了我在用第三方。我会更新我的问题。感谢ASP.NET MVC中没有复选框列表或复选框列表,因此您必须使用第三方组件。。如果不知道你具体在用什么,那就很难弄清楚了。@Erik你的权利,完全忘了我在用第三方。我会更新我的问题。Thanksi刚刚看到了完全相同的事情,我在我的代码中有这个组件很长一段时间,然后tab索引的请求开始发挥作用;完全忘记了它是第三方,所以在您提出之前,从未知道文档。非常感谢。我只是看到了完全相同的事情,我在我的代码中有这个组件很长一段时间,然后对选项卡索引的请求开始发挥作用;完全忘记了它是第三方,所以在您提出之前,从未知道文档。非常感谢。我只是看到了完全相同的事情,我在我的代码中有这个组件很长一段时间,然后对选项卡索引的请求开始发挥作用;完全忘记了它是第三方,所以在您提出之前,从未知道文档。非常感谢。我只是看到了完全相同的事情,我在我的代码中有这个组件很长一段时间,然后对选项卡索引的请求开始发挥作用;完全忘记了它是第三方,所以在您提出之前,从未知道文档。非常感谢。