Using Bind Function

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • chamarajanaka
    New Member
    • Jul 2010
    • 9

    Using Bind Function

    I need to Bind "JobRefNo" to the query string.Below binding gives an error.what is the correct way?

    Code:
    <asp:LinkButton ID="MoreLinkButton" PostBackUrl="/real/Coordinator/Home.aspx?JobRefNo="'<%# Bind("JobRefNo") %>' runat="server">Go To Job...</asp:LinkButton>
    Link Button is inside a DataList control.Error says "Call to Bind must be assigned to a property of a control inside a template"
  • Frinavale
    Recognized Expert Expert
    • Oct 2006
    • 9749

    #2
    Your approach won't work.

    You cannot add a binding for a property in the middle of a string like that.

    You need to bind to something that returns you the appropriate string.

    -Frinny

    Comment

    Working...