避免在命令字段上回发 [英] Avoid Postback on command field

查看:82
本文介绍了避免在命令字段上回发的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在gridview中有一个命令。

I have a commandfiled inside my gridview.

<asp:CommandField ShowEditButton="true"  ShowDeleteButton="true"
                EditImageUrl="~/Icons/1414412214_edit.png" EditText="Edit"
                DeleteImageUrl="~/Icons/1414412198_delete.png" UpdateText="Done"   >
            <itemstyle height="10%" width="10%" />



如何在编辑链接按钮上停止回发,并且仍然可以在单击时显示更新和取消链接。我知道我可以使用更新面板做到这一点,我试过它不起作用?


How can I stop post back on edit link button and still be able to show the update and cancel link on clicking it. I know that I can do that using update panel and I tried it did not work?

推荐答案

1.关于命令字段上的paostback点击,唯一的改进我看(因为 CommandField 对象没有AutoPostback特权)是将网格放入 UpdatePanel ,这个面板将使用AJAX只回发网格而不是整个页面。



2.有关UpdatePanel的详细信息,请参阅 MSDN [ ^ ]。
1.Regarding the paostback on command field click, the only improvement that I see (because the CommandField objects do not have AutoPostback proprieties) is to put you grid into an UpdatePanel and this panel will use AJAX to postback only you grid and not the entire page.

2.For details about UpdatePanel see into the MSDN[^].


这篇关于避免在命令字段上回发的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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