简体   繁体   English

如何使用asp.net将焦点移到GridView?

[英]how to get focus to a gridview using asp.net?

在我的网页中,如果我单击该按钮,就会有一个按钮生成一个gridview。我正在使用Tab键浏览网页...单击该按钮后,焦点不会转到gridview而是到页脚元素...。为什么需要Focus forgridview是使用nvda屏幕阅读器读出其中的内容... 问题 :我应该如何将焦点集中到gridview?

You can use jQuery for it 您可以使用jQuery

$(':text').on("focus", function(){
  //here set in localStorage id of the textbox
  localStorage.setItem("focusItem", this.id);
  //console.log(localStorage.getItem("focusItem"));test the focus element id
});

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM