随笔 - 137, 文章 - 2, 评论 - 69, 阅读 - 34万
  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理
< 2025年2月 >
26 27 28 29 30 31 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 1
2 3 4 5 6 7 8

AJAX不刷新页面

Posted on   hyd309  阅读(316)  评论(0编辑  收藏  举报
<asp:UpdatePanel ID="updatePanel" runat="server" UpdateMode="Conditional">
                <ContentTemplate>
                <asp:GridView ID="GridView1"  CssClass="tablestyle"
                    AutoGenerateColumns="false" ShowFooter="true"  DataKeyNames="PartName"
                    runat="server" onrowdatabound="GridView1_RowDataBound"
                    onrowcreated="GridView1_RowCreated">
                        <AlternatingRowStyle CssClass="altrowstyle" />
                        <HeaderStyle CssClass="headerstyle" />
                        <RowStyle CssClass="rowstyle" />
                        <FooterStyle BackColor="#E8E8EA" />
                    <Columns>
                        <asp:BoundField DataField="Height" HeaderText="重量" FooterText="重量" SortExpression="Height"/>
                        <asp:BoundField DataField="PartName" HeaderText="物品名称" FooterText="物品名称" SortExpression="PartName" ItemStyle-Width="170px"/>
                        <asp:BoundField DataField="Number1" HeaderText="数量" FooterText="数量" SortExpression="Number1" ItemStyle-Width="150px"/>
                        <asp:BoundField DataField="Price1" HeaderText="金额" SortExpression="Price1" ItemStyle-Width="150px"/>
                    </Columns>
                </asp:GridView>
                </ContentTemplate>

            </asp:UpdatePanel>

 

 

 from 后面添加:

<asp:ScriptManager ID="ScriptManager1" runat="server" />

点击右上角即可分享
微信分享提示