Displaying 6 images in itemdetails.aspx but it shows the same image

Last post 06-05-2008 11:09 PM by Cyriacus. 3 replies.

Sort Posts:

  • Displaying 6 images in itemdetails.aspx but it shows the same image

    04-24-2007, 12:44 PM
    • Loading...
    • sirpinky
    • Joined on 02-08-2007, 9:56 PM
    • Posts 30

    I have 6 images showing in my itemdetails.aspx the code:

     <asp:Image ID="Image1" CssClass="photo-border" runat="server" ImageUrl='<%# "/images/" + (string)Eval("ImageUrl") %>'
                                    AlternateText='<%# (string)Eval("ImageAltText")%>' />
                                <br />
                                <asp:Image ID="Image2" CssClass="photo-border" runat="server" ImageUrl='<%# "/images/" + (string)Eval("ImageUrl1") %>'
                                    AlternateText='<%# (string)Eval("ImageAltText")%>' />
                                <br />
                                <br />
                                <asp:Image ID="Image3" CssClass="photo-border" runat="server" ImageUrl='<%# "images/" + (string)Eval("ImageUrl2") %>'
                                    AlternateText='<%# (string)Eval("ImageAltText")%>' />
                                <br />
                                <br />
                                <asp:Image ID="Image4" CssClass="photo-border" runat="server" ImageUrl='<%# "images/" + (string)Eval("ImageUrl3") %>'
                                    AlternateText='<%# (string)Eval("ImageAltText")%>' />
                                <br />
                                <br />
                                <asp:Image ID="Image5" CssClass="photo-border" runat="server" ImageUrl='<%# "images/" + (string)Eval("ImageUrl4") %>'
                                    AlternateText='<%# (string)Eval("ImageAltText")%>' />
                                <br />
                                <br />
                                <asp:Image ID="Image6" CssClass="photo-border" runat="server" ImageUrl='<%# "images/" + (string)Eval("ImageUrl5") %>'
                                    AlternateText='<%# (string)Eval("ImageAltText")%>' />

     

    I am not too sure why it only shows ImageUrl1 & 6? Have I not done something here?

    Thanks in advance! 

  • Re: Displaying 6 images in itemdetails.aspx but it shows the same image

    04-27-2007, 8:00 AM
    • Loading...
    • sirpinky
    • Joined on 02-08-2007, 9:56 PM
    • Posts 30
    Has anyone tried this or had this problem?
  • Re: Displaying 6 images in itemdetails.aspx but it shows the same image

    08-22-2007, 4:57 PM
    • Loading...
    • figgie
    • Joined on 03-14-2007, 7:47 PM
    • Posts 24

    well the first thing that comes to mind

     

    inside the XML or DB

     

    did you create an id for each of the imageurl to correspond with the 2-6 respectively?

      

    <imageUrl>imagename.JPG</imageUrl>
    <imageUrl2>imagename2.JPG</imageUrl2>
    .
    .
    <imageUrlx>imagenamex.JPG</imageUrlx>
     

     

  • Re: Displaying 6 images in itemdetails.aspx but it shows the same image

    06-05-2008, 11:09 PM
    • Loading...
    • Cyriacus
    • Joined on 06-08-2007, 8:21 AM
    • Tampa Florida
    • Posts 9

    Your trying to eval a column that dosn't exist (string)Eval("ImageUrl1")

    The name of the column is ImageUrl not ImageUrl1 - N

    You would of had to add this to your XML or Database table and edit Item.cs (in App_Code folder) accordingly.

Page 1 of 1 (4 items)
Microsoft Communities
Page view counter