asp.net页面中只刷新datagrid中的数据。

发布网友 发布时间:2024-10-23 23:22

我来回答

2个回答

热心网友 时间:2024-10-25 03:08

直接用微软的AJAX   在你原有的程序上 加一个 UpdatePanel 就搞定了 几分钟的事情

                <asp:UpdatePanel ID="UpdateList" runat="server">
                    <ContentTemplate>
                        <div class="hidden">
                            <asp:Button ID="F_AjaxButton" runat="server" Text="自动更新" OnClick="F_AjaxButton_Click" />
                        </div>
                        <asp:Repeater ID="F_Update_List" runat="server" OnItemCommand="F_Update_List_ItemCommand"
                            OnItemDataBound="F_Update_List_ItemDataBound">
                            <HeaderTemplate>
                                <table class="list">
                                    <tr>
                                        <th>
                                            内容
                                        </th>
                                        <th>
                                            状态
                                        </th>
                                        <th>
                                            重试
                                        </th>
                                        <th>
                                            处理
                                        </th>
                                    </tr>
                            </HeaderTemplate>
                            <ItemTemplate>
                                <tr>
                                    <td>
                                        <%#Eval("Text") %>
                                    </td>
                                    <td>
                                        <asp:Label ID="F_State" runat="server" Text="" CssClass="tred"></asp:Label>
                                    </td>
                                    <td>
                                        <asp:LinkButton ID="F_Try" runat="server" CommandName="Try" CommandArgument='<%# Eval("UpdateID") %>'
                                            CssClass="lblue" Visible="false">[重试]</asp:LinkButton>
                                    </td>
                                    <td>
                                        <asp:LinkButton ID="F_Delete" runat="server" CommandName="Delete" CommandArgument='<%# Eval("UpdateID") %>'
                                            OnClientClick="return confirm( '您确定要执行吗?');" CssClass="lblue" Visible="false">[删除记录]</asp:LinkButton>
                                    </td>
                                </tr>
                            </ItemTemplate>
                            <FooterTemplate>
                                </table>
                            </FooterTemplate>
                        </asp:Repeater>
                    </ContentTemplate>
                </asp:UpdatePanel>

追问是不是 v3.0的不能用?

热心网友 时间:2024-10-25 03:08

ajax 刷新追问详细一点啊 我没接触过。谢谢啦

声明声明:本网页内容为用户发布,旨在传播知识,不代表本网认同其观点,若有侵权等问题请及时与本网联系,我们将在第一时间删除处理。E-MAIL:11247931@qq.com