Solved

Webpage to display three images

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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Suggested Solutions

IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

840 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