【问题标题】:How can I pass along the Page Number in a HyperLinkField in a GridView?如何在 GridView 的 HyperLinkField 中传递页码?
【发布时间】:2009-02-27 20:50:42
【问题描述】:

我有我正在使用分页的gridview。我想在 asp:Hyperlink 中传递当前页面,以便在他们查看完记录的详细信息后将它们发送回当前页面。这可能吗?如果是这样,我该怎么做?

<asp:GridView ID="grdObitList" runat="server" allowpaging="true"
            PageSize="10" AutoGenerateColumns="false" CssClass="grdClass" 
                BorderStyle="None" GridLines="None" CellSpacing="2" >
            <PagerStyle HorizontalAlign="Center" />
            <PagerSettings Position="Bottom" FirstPageText="First" LastPageText="Last" Mode="NumericFirstLast"  />
               <Columns>     
                   <asp:HyperLinkField HeaderText="Name" DataTextField="obit_fullname" DataNavigateUrlFields="obit_id" DataNavigateUrlFormatString="obitDisplay.aspx?oid={0}" />                                     
                   <asp:BoundField ReadOnly="true" HeaderText="Date" DataField="obit_dod" DataFormatString="{0:d/M/yyyy}" />
                   <asp:BoundField ReadOnly="true" HeaderText="Resident Of" DataField="obit_resident" />
                   <asp:BoundField ReadOnly="true" HeaderText="Funeral Home" DataField="obit_funeralhome" />
               </Columns>

【问题讨论】:

    标签: asp.net vb.net gridview


    【解决方案1】:

    一种方法是将其转换为模板列,这样您就可以使用普通的数据绑定语法来获取它 (

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-03-19
      • 2010-10-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多