我正在尝试在gridview中点击一行,这样它就会导致回发,以便我可以执行代码隐藏。
我在GridView的RowDataBound事件处理程序中有这个。这个工作:
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.Attributes["onmouseover"] = "this.style.cursor='pointer';this.style.textDecoration='underline';";
e.Row.Attributes["onmouseout"] = "this.style.textDecoration='none';";
e.Row.Attributes["onclick"] = "javascript:__doPostBack('PostBackFromItemWindow', '');";
}
但这不起作用:
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.Attributes["onmouseover"] = "this.style.cursor='pointer';this.style.textDecoration='underline';";
e.Row.Attributes["onmouseout"] = "this.style.textDecoration='none';";
e.Row.Attributes["onclick"] = "<script type='text/javascript'>__doPostBack('PostBackFromItemWindow', '');</script>";
}
问题: