how to create onclick, onmouse over, onmouseout event in code behind file in asp.net

  • You can create the onclick, onmouseover and onmousemove event in code behind file and perform the specify operation like change color,...etc.

         protected void GridView1_RowDataBound1(object sender, GridViewRowEventArgs e)
        {
              if (e.Row.RowType == DataControlRowType.DataRow)
              {
                   System.Data.DataRowView dr = e.Row.DataItem as System.Data.DataRowView;
                   e.Row.Attributes.Add("ondblclick", String.Format(

                   "window.location='Default.aspx?id={0}'", dr["id"]));
              }
        }