HI all,
I have a gridview like this.anchor inside gridview contains an id
<asp:GridView ID="GridView1" AutoGenerateColumns="False" runat="server"
Width="111px">
<Columns>
<asp:TemplateField HeaderText="ID">
<ItemTemplate>
<a id='<%#Eval("pid")%>' href="#" ><image id ="img1" > </image> </a>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
my requirement is i have a folder named dloadid,that contains some id's.
if the anchor id is matched with id in folder,set the src of image.
i tried this
$(document).ready(function () {
$("#<%=GridView1.ClientID%> tr:has(td)").each(function () {
var cell = $(this).find("td:eq(0)");
// var cell = $(this).attr("id");
// alert(cell.attr("id"));
var id = $('a').attr("id");
alert(id);
if(id=='./dload')
{
var nimage = './Images/pdf_icon.png';
$("#img1").attr('src', nimage);
}
});
});
but not working. any idea about this.
Regards
Baiju