Quantcast
Channel: SQLServerCentral » SQL Server 2014 » Development - SQL Server 2014 » Latest topics
Viewing all articles
Browse latest Browse all 3145

Display grid view image based on another column value

$
0
0
I want to display image based on another templatefield value.Example person num(0010200) and image saved in folder is 00102000.jpg , if person num(01234) and image saved in folder is 01234.jpg, etc. like this i have many employee images.and this all saved in /img/ webfolder.Now when ever lable2 person num changes i need to change the image1 which will be same as person num,please suggest me to achieve the same. example code below.<asp:TemplateField HeaderText="person_num" SortExpression="person_num"> <ItemTemplate> <asp:Label ID="Label2" runat="server" Text='<%# Bind("person_num") %>'></asp:Label> </ItemTemplate></asp:TemplateField><asp:BoundField DataField="full_name" HeaderText="full_name" SortExpression="full_name" /><asp:TemplateField HeaderText="Image"> <ItemTemplate> <asp:Image id="Image1" runat="server" ImageUrl='<%# Bind("person_num") %>'match as "img/(0)"/> </ItemTemplate></asp:TemplateField>

Viewing all articles
Browse latest Browse all 3145

Trending Articles