Solved

Webpage to display three images

Posted on 2011-09-26
3
177 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 29

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Come and listen to Percona CEO Peter Zaitsev discuss what’s new in Percona open source software, including Percona Server for MySQL (https://www.percona.com/software/mysql-database/percona-server) and MongoDB (https://www.percona.com/software/mongo-…
This video Micro Tutorial shows how to password-protect PDF files with free software. Many software products can do this, such as Adobe Acrobat (but not Adobe Reader), Nuance PaperPort, and Nuance Power PDF, but they are not free products. This vide…

724 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