How do I pass a parameter from a hyperlinkbutton embedded in a repeater?

Posted on 2006-04-08
Last Modified: 2006-11-18
The subject line pretty much says it all.

I want to have a hyperlinkbutton embbeded in a repeater. I want to dynamically create the parameter that will be passed into a method based on whatever is loaded into the hyperlinkbutton on the databind() event. Here is the code that is NOT working. When I go to buld the site I get this message "Server tags cannot contain <% ... %>"

<%--Begin TicketHistoryRepeater--%>
<asp:Repeater ID="TicketHistoryRepeater" runat="server" EnableViewState="true">
        <asp:Label ID="lblTicketID" runat="server" Text=<%#Eval ("TicketID") %>>
        <asp:LinkButton ID="lkSubject" runat="server" Text=<%Eval("Subject") %>
           OnClick="ShowAnswerTable(<%#Eval (TicketID) %>)"></asp:LinkButton>
        <asp:Label ID="lblDateOpened" runat="server" Text=<%#Eval ("Date") %>>
        <asp:Label ID="lblStatus" runat="server" Text=<%#Eval ("Status") %>>
<%--End TicketHistoryRepeater--%>

I know that this may be easy, but I have a april 19th deadline I'm fighting. So, 500 points it is. THANKS!
Question by:tatton777
    1 Comment
    LVL 10

    Accepted Solution

    you must replace: Text=<%#Eval ("field") %>
    with this: Text='<%#Eval ("field") %>'

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Join & Write a Comment

    Suggested Solutions

    This article discusses the ASP.NET AJAX ModalPopupExtender control. In this article we will show how to use the ModalPopupExtender control, how to display/show/call the ASP.NET AJAX ModalPopupExtender control from javascript, how to show/display/cal…
    IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    730 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now