Webpage to display three images

Posted on 2011-09-26
Last Modified: 2013-12-17

I want to place three images on a web page next to each other, the images that will be returned need to be selectable from database entries which should link to the location of the image.

We have pictures which are taken which follow the following database entries

countryCode         cityCode       storeCode         StoreType        gridCodeX           filePath
44                          01                001                     S                     AA11                    c:\pics\44\01\001\S\AA11.jpg
44                           01                001                    S                     XY99                    c:\pics\44\01\001\S\XY99

and so on..........

Is it possible to select the country, city, store etc then the picture relating to that entry appears. We have two other images which I need to be presented next to the above. The location information for the other two are basically the same but I need to display the last two dated files in the directory that has been selected, I'm really not sure if this is possible but I thought I'd put the question in here anyway.

I can provide any files tht might be needed to guide me in this, our pages are .asp, we use and I use .net 4 and Visual Studio to create my pages and also C#.

Any help would be much appreciated/

Best Regards,


We use a site template which we use to keep the look and feel of our system the same
Question by:kenuk110
LVL 96

Expert Comment

by:Bob Learned
ID: 36670372
That sounds like a job for a Repeater, with a horizontal repeat direction, and an image control in the template...
LVL 28

Accepted Solution

sammySeltzer earned 500 total points
ID: 36714178
When I did for my organization, I used formview to display data.

I would store the image name called picts on the db and store the actual images on a folder called MemberPhotos.

Here is a sample. You can modify to suit your needs.

      <asp:FormView ID="FormView1" Runat="server" DataSourceID="APOMembers" HeaderText="&nbsp;" AllowPaging="True" Width="562px">
              <td valign="top">
                <asp:Label ID="Label11" Font-Size="1.2em" Font-Bold="true" Text='<%# Eval("tTitle") %>' runat="server" />
                <asp:Label ID="Name" Font-Size="1.2em" Font-Bold="true" Text='<%# Eval("Name") %>' runat="server" />
                <hr width="120"/>
                <br/><font style="Font-Size:1.2em; Font-Weight:Bold">Cell Phone:</font>
                <asp:Label ID="Cell_Phone" Text='<%# Eval("cell_phone") %>' runat="server" />
                <br/><font style="Font-Size:1.2em; Font-Weight:Bold">Home Phone:</font>
                <asp:Label ID="Label1" Text='<%# Eval("phone") %>' runat="server" />
                <br/><font style="Font-Size:1.2em; Font-Weight:Bold">Email:</font>
                <asp:Label ID="Label2" Text='<%# Eval("Email_Add") %>' runat="server" />
                <br/><font style="Font-Size:1.2em; Font-Weight:Bold">Registered On:</font>
                <asp:Label ID="Label3" Text='<%# Eval("DateOfRegistration","{0:MM/dd/yyyy}") %>' runat="server" />
                <br/><font style="Font-Size:1.2em; Font-Weight:Bold">Address:</font>
                <asp:Label ID="Label4" Text='<%# Eval("Address") %>' runat="server" />
                <br/><font style="Font-Size:1.2em; Font-Weight:Bold">City:</font>
                <asp:Label ID="Label5" Text='<%# Eval("City") %>' runat="server" />
                <br/><font style="Font-Size:1.2em; Font-Weight:Bold">State:</font>
                <asp:Label ID="Label6" Text='<%# Eval("State") %>' runat="server" />
                <br/><font style="Font-Size:1.2em; Font-Weight:Bold">Zip:</font>
                <asp:Label ID="Label8" Text='<%# Eval("Zip") %>' runat="server" />
                <br/><font style="Font-Size:1.2em; Font-Weight:Bold">Comments:</font>
                <asp:Label ID="Label10" Text='<%# Eval("Comments") %>' runat="server" />
               <td valign="middle">
                <asp:Image ID="ImageDetailItem" width="250" ImageUrl='<%# IIF(CONVERT.ToString(Eval("picts"))="", "~/memberPhotos/NoPic.jpg", Eval("picts","~/memberPhotos/{0}.jpg")) %>' runat="server" />                                        

Open in new window

      A sqldatasource selectcommand:
                <asp:SqlDataSource ID="APOMembers" runat="server" ConnectionString="<%$ ConnectionStrings:APOConnectionString %>"
                 ProviderName="<%$ ConnectionStrings:APOConnectionString.ProviderName %>"
                    SelectCommand="SELECT ID, ([firstName]&' '& [LastName]) as Name, [Cell_Phone], [Phone], [Email_Add], [tTitle], [DateOfRegistration], [Address], [City], [State], [Zip], [Comments], [picts] FROM mytable WHERE [ID] = @ID">
                    <asp:QueryStringParameter Name="ID" QueryStringField="ID" Type="Decimal" />

Open in new window

Hopefully, this leads in the right direction.

Author Comment

ID: 36714503

Thank you so much for this, I will try this out today on our system and get back to you.

Really appreciate the code.

Best Regards,


Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question