Help with asp:imagebutton image path

Ask a Question related to Dreamweaver AppDev, Design and Development.

  1. #1

    Default Help with asp:imagebutton image path

    Hi

    I'm a little stuck and hoping for some advice, asp.net vb
    I have a datalist on a page to show users thumbnails, the photos are
    displayed as asp:imagebuttons & the datalist has an onitemcommand called
    getPhotos which runs as follows

    sub getPhotos(sender as object etc)
    Dim myIndex = e.Item.ItemIndex
    Dim myPage = myIndex + 1
    Response.Redirect("showphoto.aspx?page=" + myPage.ToString() + "&id=" +
    myid.ToString())
    end sub

    on the showphoto page I am using a paged repeater with nav controls to allow
    back & forward paging of photos
    The problem that I have is that my imageUrl doesn't work

    imageUrl='media/profiles/<%# Container.DataItem("userID") %>/<%#
    Container.DataItem("filename") %>'

    If I use the same path in a standard <img> tag all is fine but I can't seem
    to access the itemindex to get the correct photo & page number
    My thoughts were to create a single string containing the full path at
    page_load or create a function to bring it all together. I'm totally stuck
    so any advice would be gratefully received
    Thanks
    Dave


    dizzy Guest

  2. Similar Questions and Discussions

    1. Attaching Image to Path
      I'm trying to attach an image to a path similar to attaching text to a path. My goal is to manipulate an image to realistically wrap around irregular...
    2. An ImageButton that retrieves its image from a Resource
      I can't find any documentation on retrieving an imagebutton's image from a resource file in asp.net 2.0. Can someone help with a small example or...
    3. Need to change image of imagebutton in datagrid template column
      I'm going nuts.. I've got a template column with an imagebutton in it. I would like to change the image on the button when the button is clicked. ...
    4. Placing an image? Path?
      Hello folks. A few questions - issues if I may. I don't see where to "place" an image from Freehand MX? The reason for placing is, that I was...
    5. image/imagebutton client validation
      Hi is there any way i can call a clientside function for validation onClick of a Image or imagebutton? Right now my image or imagebutton is...
  3. #2

    Default Re: Help with asp:imagebutton image path

    Duh solved it
    answer was
    imageUrl='<%# "../media/profiles/" & container.dataitem("userID") & "/tn_" &
    container.dataitem("filename") %>'


    dizzy Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139