本文介绍了禁用gridview的刷新当选择特定的行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在GridView禁用刷新当选择一个特定的行,因为它是刷新整个页面,因为我有兵地图重新加载每次。

I need to disable refresh in a GridView when a particular row is selected as it is refreshing the whole page as I have bing map reloaded everytime.

我曾尝试

function showKeyCode(e)
{
    var keycode = (window.event) ? event.keyCode : e.keyCode;
    if (keycode == 116) {
        event.keyCode = 0;
        event.returnValue = false;
        return false;
}

OnClientClick = "javascript:return false;"

但它并不能帮助。能否请你指导我在这?

but it does not help. Can you please guide me in this?

推荐答案

当你说当一个特定的行被选中,你的意思,你点击一个选择一列或类似的东西联系?

When you say "when a particular row is selected", do you mean you click on a "Select" link in a column or something similar?

我想你应该告诉更多有关你的GridView知道为什么,有一个页面回发

I think you should tell more about your GridView to know why there is a page postback.

编辑:下面是一个示例(结帐使用ScriptManager和UpdatePanel中)

Here's a sample (Checkout the ScriptManager and UpdatePanel)

<form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="true">
    </asp:ScriptManager>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <asp:gridview runat="server" EnableModelValidation="True" ID="MyGrid">
            </asp:gridview>
        </ContentTemplate>
    </asp:UpdatePanel>
</form>

希望这有助于

这篇关于禁用gridview的刷新当选择特定的行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-18 17:16
查看更多