2012-02-06 86 views
2

編輯:2012年2月7日 - 原來,關鍵參數從排序後,在GridView編輯鏈接會消失一樣,所以它不會出現是尋呼機畢竟,但是問題依然存在......任何想法都非常受歡迎。動態數據的GridView尋呼機缺少DynamicHyperlink編輯參數

我有一個Asp.Net動態數據的應用程序。它使用自定義List.aspx標準GridViewPager.aspx被標記成這樣:

<asp:GridView ID="GridView1" runat="server" DataSourceID="GridDataSource" EnablePersistedSelection="True" CssClass="DDGridView" HeaderStyle-CssClass="th" RowStyle-CssClass="td" CellPadding="6" AllowSorting="True" AllowPaging="True" PageSize="3" 
    OnRowDataBound="GridView_OnRowDataBound" OnRowDeleting="GridView_OnRowDeleting"> 
    <Columns> 
     <asp:TemplateField> 
      <ItemTemplate> 
       <asp:LoginView ID="LoginView1" runat="server"> 
        <RoleGroups> 
         <asp:RoleGroup Roles="admin"> 
          <ContentTemplate> 
           <asp:DynamicHyperLink ID="EditLink" runat="server" Action="Edit" Text="edit" /> 
           &nbsp; 
           <asp:LinkButton ID="LinkButton1" runat="server" CommandName="Delete" Text="delete" OnClientClick='return confirm("Are you sure you want to delete this item?");' /> 
          </ContentTemplate> 
         </asp:RoleGroup> 
        </RoleGroups> 
       </asp:LoginView> 
      </ItemTemplate> 
     </asp:TemplateField> 
    </Columns> 
    <PagerStyle CssClass="DDFooter" /> 
    <PagerTemplate> 
     <asp:GridViewPager runat="server" /> 
    </PagerTemplate> 
    <EmptyDataTemplate> 
     There are currently no items in this table. 
    </EmptyDataTemplate> 
</asp:GridView> 

在第1頁列表的一切都很好。渲染編輯鏈接包括?key=xxxxx和編輯的形式打開正確的記錄。

一旦我們頁面關閉1然而,呈現在每行的編輯鏈接沒有「關鍵」參數和編輯表單始終打開到數據庫中的第一行。

我茫然地解釋,甚至在哪裏看。沒有自定義代碼附加到與Edit DynamicHyperlink或GridviewPager相關聯的任何事件。

有沒有人經歷過這種或有任何建議,可能是什麼問題?

回答