protected void ListView1_ItemDataBound(object sender, ListViewItemEventArgs e)
{
if (e.Item.ItemType == ListViewItemType.DataItem)
{
object objTemp = ListView1.DataKeys[((ListViewDataItem)e.Item).DisplayIndex].Value as object;
if (objTemp != null)
{
string id = objTemp.ToString();
((HtmlTableRow)e.Item.FindControl("courserow")).Attributes["onmouseover"] = "this.style.color='DodgerBlue';this.style.cursor='hand';";
((HtmlTableRow)e.Item.FindControl("courserow")).Attributes["onmouseout"] = "this.style.color='Black';";
((HtmlTableRow)e.Item.FindControl("courserow")).Attributes["onclick"] = "window.location.href = 'ManageCourse.aspx?CourseId=" + id + "'";
}
}
}
You need the runtat attribute set to server for "courserow" row.
No comments:
Post a Comment