如何在按钮单击期间停止完整回发 [英] how to stop full postback during button click

查看:52
本文介绍了如何在按钮单击期间停止完整回发的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个带有文本框和按钮的网格视图。当我点击按钮时,成功添加了一个新行,并且还发布了完整的回发。我想要停止完整回发以及在回发期间做其他工作。

I have a grid view with text boxes and button.When i click button a new row is added successfully and as well as full post back occurs.I want to stop full post back and as well as do other jobs during post back.

推荐答案

嗨Sandip,



您可以使用更新面板 [ ^ ]。



您可以使用以下代码:

Hi Sandip,

You can use Update Panel[^].

You can use following code:
<asp:TemplateField>
     <FooterTemplate>
          <asp:UpdatePanel ID="upnlBtnAdd" runat="server">
                    <asp:LinkButton ClientIDMode="static" runat="server" ID="btnAdd" Text="Add" OnClick="btnAdd_Click"></asp:LinkButton>
          </asp:UpdatePanel>
     </FooterTemplate>
</asp:TemplateField>


请参阅此



http://forums.asp.net/t/1652213.aspx?Link+button+in+gridview+causing+full+postback [ ^ ]

如何为命令栏添加postbacktrigger [ ^ ]
Refer this

http://forums.asp.net/t/1652213.aspx?Link+button+in+gridview+causing+full+postback[^]
How to add the postbacktrigger for the commandfield[^]


将Ispostback属性设置为False
set the Ispostback property to False


这篇关于如何在按钮单击期间停止完整回发的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆