GridView Image button
-
hi freds.. I am facing an issue in gridview control(asp.Net,c#), see below code panel
<asp:TemplateField HeaderText="Action">
<ItemTemplate><asp:ImageButton ID="imgLiveTest" CommandName="<%#DataBinder.Eval(Container.DataItem,"type")%>" ImageUrl='<%# GetImageTestLive(DataBinder.Eval(Container.DataItem,"liveServer")) %>' OnClick="imgLiveTest\_click" runat="server" /> <asp:ImageButton ID="Edit" CommandName="<%#DataBinder.Eval(Container.DataItem,"type")%>" OnClick="Edit\_click" ImageUrl="images/edit.gif" runat="server" /> <asp:ImageButton ID="Delete" CommandName="<%#DataBinder.Eval(Container.DataItem,"type")%>" OnClick="delete\_click" ImageUrl="images/cancel.gif" runat="server" /> </ItemTemplate> </asp:TemplateField>
But I am not able to to see image in gridview, where as path is correct, and in source code ImageButton not renderd as html code they are same as aspx. Thanks, Abbas
-
hi freds.. I am facing an issue in gridview control(asp.Net,c#), see below code panel
<asp:TemplateField HeaderText="Action">
<ItemTemplate><asp:ImageButton ID="imgLiveTest" CommandName="<%#DataBinder.Eval(Container.DataItem,"type")%>" ImageUrl='<%# GetImageTestLive(DataBinder.Eval(Container.DataItem,"liveServer")) %>' OnClick="imgLiveTest\_click" runat="server" /> <asp:ImageButton ID="Edit" CommandName="<%#DataBinder.Eval(Container.DataItem,"type")%>" OnClick="Edit\_click" ImageUrl="images/edit.gif" runat="server" /> <asp:ImageButton ID="Delete" CommandName="<%#DataBinder.Eval(Container.DataItem,"type")%>" OnClick="delete\_click" ImageUrl="images/cancel.gif" runat="server" /> </ItemTemplate> </asp:TemplateField>
But I am not able to to see image in gridview, where as path is correct, and in source code ImageButton not renderd as html code they are same as aspx. Thanks, Abbas
Just right click on the image control (which is rendered as no image) and see if the path that its src has can be accessible by directly putting in the browser. You need to have access previledge to a path from the client to see the image. Also why do you use : ImageUrl='<%# GetImageTestLive(DataBinder.Eval(Container.DataItem,"liveServer")) %>' single quote here while using double quote for all others. :doh:
Abhishek Sur **Don't forget to click "Good Answer" if you like this Solution.
My Latest Articles-->****
InfoBox Visual Studio 2010 Extension
Windows7 API Code Pack
Simplify Code Using NDepend** -
Just right click on the image control (which is rendered as no image) and see if the path that its src has can be accessible by directly putting in the browser. You need to have access previledge to a path from the client to see the image. Also why do you use : ImageUrl='<%# GetImageTestLive(DataBinder.Eval(Container.DataItem,"liveServer")) %>' single quote here while using double quote for all others. :doh:
Abhishek Sur **Don't forget to click "Good Answer" if you like this Solution.
My Latest Articles-->****
InfoBox Visual Studio 2010 Extension
Windows7 API Code Pack
Simplify Code Using NDepend**hi Abhi thanks for answer, actually i was using image path according function returns value, but now we using RowCreated event thats working fine. Thanks,
-
hi Abhi thanks for answer, actually i was using image path according function returns value, but now we using RowCreated event thats working fine. Thanks,
Oh this is great to hear that it solved. Cheers :thumbsup:
Abhishek Sur **Don't forget to click "Good Answer" if you like this Solution.
My Latest Articles-->****
InfoBox Visual Studio 2010 Extension
Windows7 API Code Pack
Simplify Code Using NDepend**