Solved

Webpage to display three images

Posted on 2011-09-26
3
172 Views
Last Modified: 2013-12-17
Hi,

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,

Ken

We use a site template which we use to keep the look and feel of our system the same
0
Comment
Question by:kenuk110
3 Comments
 
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...
0
 
LVL 28

Accepted Solution

by:
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">
        <ItemTemplate>
          <table>
            <tr>
              <td valign="top">
                <asp:Label ID="Label11" Font-Size="1.2em" Font-Bold="true" Text='<%# Eval("tTitle") %>' runat="server" />
                &nbsp;
                <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>
               <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" />                                        
 
              </td>
            </tr>
          </table>
        </ItemTemplate>
      </asp:FormView>

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">
                  <SelectParameters>
                    <asp:QueryStringParameter Name="ID" QueryStringField="ID" Type="Decimal" />
                  </SelectParameters>
              </asp:SqlDataSource>

Open in new window


Hopefully, this leads in the right direction.
0
 

Author Comment

by:kenuk110
ID: 36714503
Sammy,

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,

Ken
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

705 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now