如何解决?
我在 Page_Load、Page_PreRender 和标记中声明了处理程序。它不能正常工作。
代码:
<asp:GridView ID="tableResults" runat="server" DataMember="Table" EnableModelValidation="True"
CssClass="GridViewStyle" OnRowDeleting="dataViewRowDeleting" AutoGenerateDeleteButton="True">
<HeaderStyle CssClass="GridViewHeaderStyle" />
<RowStyle CssClass="GridViewRowStyle" />
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:HyperLink ID="HyperLink1" runat="server" Text="Скачать объект" NavigateUrl='<%#"objects/" + Eval("Идентификатор") %>'></asp:HyperLink>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
处理程序:
tableResults.AutoGenerateEditButton = true;
tableResults.RowEditing += new GridViewEditEventHandler(tableResults_RowEditing);
tableResults.RowUpdating += new GridViewUpdateEventHandler(tableResults_RowUpdating);
tableResults.RowCancelingEdit += new GridViewCancelEditEventHandler(tableResults_RowCancelingEdit);