ImageButton ImageURL question

Discussion in 'ASP .Net Web Controls' started by Pradeep, Jan 27, 2005.

  1. Pradeep

    Pradeep Guest

    I wanted to call <%# DataBinder.Eval(Container.DataItem, "ImageURL") %>" in
    the ImageUrl for my ImageButton as depending on what I have in my ImageUrl, I
    would want to be able to show different images.


    <ASP:DataList id="MyDataList" runat="server" RepeatLayout="Table">

    <HeaderTemplate>
    <div class="rHead">
    List of Servers
    </div>
    <img src="images/redrule.gif">
    </HeaderTemplate>

    <ItemTemplate>
    <span>
    <a >
    <img id="one" src="images/<%# DataBinder.Eval(Container.DataItem,
    "ImageURL") %>" />
    </a><br />
    <asp:ImageButton id="imagebutton1" runat="server" ImageUrl="images/<%#
    DataBinder.Eval(Container.DataItem, "ImageURL") %>" CommandName="<%#
    DataBinder.Eval(Container.DataItem, "Title") %>" /><br />
    <b><%# DataBinder.Eval(Container.DataItem, "Title") %></b><br />
    <%# DataBinder.Eval(Container.DataItem, "ISBN") %> <br />
    <%# DataBinder.Eval(Container.DataItem, "PublicationDate", "{0:d}") %><br
    />
    <%# DataBinder.Eval(Container.DataItem, "Precis") %><br />
    <a id="Child Nodes" href="http://www.google.com" target="_parent">Go To
    Child Nodes >></a><br />
    <br />
    </span>
    </ItemTemplate>

    </ASP:DataList><p />
    Pradeep, Jan 27, 2005
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Leigh Kendall

    Hyperlink w/ImageUrl bug?

    Leigh Kendall, Jul 29, 2003, in forum: ASP .Net
    Replies:
    8
    Views:
    469
    John Soulis [MSFT]
    Aug 19, 2003
  2. DC
    Replies:
    2
    Views:
    974
  3. Gary K
    Replies:
    2
    Views:
    431
    Gary K
    Jan 8, 2008
  4. doll
    Replies:
    0
    Views:
    556
  5. Replies:
    0
    Views:
    613
Loading...

Share This Page