This way:
HTML:
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js">
</script>
<script type="text/javascript">
$(document).ready(function () {
$('[id*=lnkDeleteTask] img').mouseover(function () {
$(this).attr('src', 'Images/icon-floppy.gif');
});
$('[id*=lnkDeleteTask] img').mouseout(function () {
$(this).attr('src', 'Images/icon-pencil.gif');
});
});
</script>
</head>
<body>
<form id="form2" runat="server">
<div>
<asp:GridView ID="gvEmployess" runat="server" AutoGenerateColumns="false">
<Columns>
<asp:BoundField DataField="LastName" HeaderText="LastName" />
<asp:BoundField DataField="Country" HeaderText="Country" />
<asp:TemplateField HeaderText="DELETE">
<ItemTemplate>
<asp:LinkButton ID="lnkDeleteTask" runat="server" CausesValidation="False"><img src="Images/icon-pencil.gif" /></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>
</form>
</body>
</html>
C#:
protected void Page_Load(object sender, EventArgs e)
{
if (!this.IsPostBack)
{
this.GetEmployees();
}
}
private void GetEmployees()
{
string constr = ConfigurationManager.ConnectionStrings["constr"].ConnectionString;
string sqlStatment = "SELECT LastName,Country FROM Employees";
using (SqlConnection con = new SqlConnection(constr))
{
using (SqlCommand cmd = new SqlCommand(sqlStatment, con))
{
using (SqlDataAdapter da = new SqlDataAdapter(cmd))
{
DataSet ds = new DataSet();
da.Fill(ds);
this.gvEmployess.DataSource = ds;
this.gvEmployess.DataBind();
}
}
}
}
Namespace:
using System.Configuration;
using System.Data.SqlClient;
using System.Data;
Image:

First Image comes on MouseOver.
Thank You.