• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 221
  • Last Modified:

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

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">
  <ItemTemplate>
    <tr>
      <td>
        <asp:Label ID="lblTicketID" runat="server" Text=<%#Eval ("TicketID") %>>
        </asp:Label>                                
      </td>
      <td>
        <asp:LinkButton ID="lkSubject" runat="server" Text=<%Eval("Subject") %>
           OnClick="ShowAnswerTable(<%#Eval (TicketID) %>)"></asp:LinkButton>
      </td>
      <td>
        <asp:Label ID="lblDateOpened" runat="server" Text=<%#Eval ("Date") %>>
        </asp:Label>
      </td>
      <td>
        <asp:Label ID="lblStatus" runat="server" Text=<%#Eval ("Status") %>>
        </asp:Label>
      </td>
    </tr>
  </ItemTemplate>                        
</asp:Repeater>
<%--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!
0
tatton777
Asked:
tatton777
1 Solution
 
aki4uCommented:
you must replace: Text=<%#Eval ("field") %>
with this: Text='<%#Eval ("field") %>'
0

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now