Thursday, 24 January 2013

display images fom folder in gridview code for source code using asp.net c#

<asp:GridView ID="gdvfileupload" runat="server" AutoGenerateColumns="False" style="text-align: center"
                            Width="500px">
                            <Columns>
                                <asp:TemplateField HeaderText="imageid">
                                    <ItemTemplate>
                                        <asp:Label ID="lblimageid" runat="server" Text='<%#Eval("imageid") %>'></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="image name">
                                    <ItemTemplate>
                                        <asp:Label ID="lblimage" runat="server" Text='<%#Eval("imagename") %>'></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField>
                                    <ItemTemplate>                                     
                                       <asp:Image ID="image1" runat="server" ImageUrl='<%#Eval("imagepath") %>' Width="100" />
                                    </ItemTemplate>
                                </asp:TemplateField>
                            </Columns>
                        </asp:GridView>

No comments:

Post a Comment