更新时间:2023-11-24 13:05:22
参考我以前的解决方案关于在asp.net中选择行的gridview的火客户端事件 [ ^ ]。
而不是visible =false
,请执行style =display:none;
。因为当你设置Visible为false时,它不会在浏览器上呈现,所以你将无法在客户端做任何事情。
现在进入JavaScript
函数,尝试删除display:none
。
Refer my previous solution fire client side event for gridview on selection of row in asp.net[^].
Instead of doingvisible="false"
, dostyle="display: none;"
. Because when you set Visible false, it don't render that on browser, so you won't be able to do anything to that in client side.
Now in thatJavaScript
function, try to remove thedisplay: none
.
function gridRowOnclick(element)
{
alert("GridView clicked");
var yourTable = document.getElementById("tbljobAction");
yourTable.style.display = yourTable.style.display === 'none' ? '' : 'none';
}