单击网格视图行时,我不希望重新加载整个页面。下面是被调用的代码。
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
try
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.Attributes["onmouseover"] = "this.style.cursor='pointer';this.style.textdecoration='underline';this.style.background='#DDDDDD';";
if ((e.Row.RowIndex % 2) == 0) // if even row
e.Row.Attributes["onmouseout"] = "this.style.textdecoration='none';this.style.cursor='pointer';this.style.background='#EFF3FB';";
else
e.Row.Attributes["onmouseout"] = "this.style.textdecoration='none';this.style.cursor='pointer';this.style.background='White';";
e.Row.Attributes.Add("onclick", "Javascript:__doPostBack('myClick','" + e.Row.RowIndex + "');");
}
}
}