Solved

Webpage to display three images

Posted on 2011-09-26
3
176 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…

730 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