我在 GridViewFirstName
和LastName
. 我希望 FirstName 列中的所有行都位于超链接中。我已经尝试过了,但没有奏效。我该怎么做 ?
解析器错误
Parser Error Message: Databinding expressions are only supported on objects
that have a DataBinding event. System.Web.UI.WebControls.HyperLinkField does not
have a DataBinding event.
代码:
<asp:GridView ID="CustomersGridView" runat="server" AutoGenerateColumns="False">
<Columns>
<asp:BoundField DataField="FirstName" HeaderText="First Name" />
<asp:BoundField DataField="LastName" HeaderText="Last Name" />
<asp:HyperLinkField Text='<%# Eval("FirstName") %>' />
</Columns>
</asp:GridView>