Results 1 to 2 of 2

Thread: databinding to a hyperlink control.

  1. #1

    Thread Starter
    Super Moderator Wokawidget's Avatar
    Join Date
    Nov 2001
    Location
    Headingly Occupation: Classified
    Posts
    9,632

    databinding to a hyperlink control.

    I have:
    VB Code:
    1. <asp:HyperLink id="lnkEdit" ImageUrl="/Resource/Edit.gif" NavigateUrl='<%# DataBinder.Eval(container.DataItem, "DivisionKey") %>' runat="server">
    2. </asp:HyperLink>
    Which is good.
    When I hover my mouse over it show's this correctly.
    However, for the navigate URL I would like:
    VB Code:
    1. NavigateUrl='Woof.aspx?Moose=<%# DataBinder.Eval(container.DataItem, "DivisionKey") %>'
    BUT when I add the Woof.aspx text then the hyperlink no longer displays the value from my dataset, but in fact actually shows the "<%# DataBinder..." in my link.

    Any ideas?

    Woof

  2. #2

    Thread Starter
    Super Moderator Wokawidget's Avatar
    Join Date
    Nov 2001
    Location
    Headingly Occupation: Classified
    Posts
    9,632

    Re: databinding to a hyperlink control.

    Done it.
    Code:
    <asp:HyperLink id="lnkEdit" ImageUrl="/Resource/Edit.gif" NavigateUrl='<%# "AFREdit.aspx?DivisionKey=" & DataBinder.Eval(Container.DataItem,"DivisionKey") & "&OperatingUnitKey=" & DataBinder.Eval(Container.DataItem,"OperatingUnitKey")%>' runat="server">
    </asp:HyperLink>
    Woof

Posting Permissions

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



Click Here to Expand Forum to Full Width