日期:2014-05-17  浏览次数:20533 次

GridView页面没有实现无刷新更新数据
本帖最后由 tjgcsf_yh 于 2012-12-27 09:54:45 编辑

  <div>
               <asp:ScriptManager ID="ScriptManager1" runat="server">
               </asp:ScriptManager>
               <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                 <ContentTemplate>
              
    <table>
       <tr>
          <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="false"  DataKeyNames="ID"
               PageSize="15">
               <Columns>
                  <asp:BoundField DataField="id" HeaderText="序列号" />
                  <asp:BoundField DataField="name" HeaderText="姓名" />                 
               </Columns>
          </asp:GridView>        
       </tr>
       <tr>
          <asp:Repeater ID="Repeater1" runat="server"  > //生成自定义格式的数字页码
             <ItemTemplate>
                 <asp:LinkButton runat="server" ID="lnkBtn"  EnableViewState="true"
                  CommandArgument='<%#Eval("page") %>' CommandName="PageNum" OnClick="lnkBtn_Click"><%#Eval("page") %></asp:LinkButton>
             </ItemTemplate>
           </asp:Repeater>
        </tr>
      </table>         
      </ContentTemplate>
</asp:UpdatePanel>
</div>

,执行的时候单击数字页码,页面都刷新一下,什么原因呢

------解决方案--------------------
把UpdatePanel放进gridview  itemTemplate里面试试。然后加trigger 把button的id给它