如何在更新面板外更新gridview? [英] How to update gridview outside update panel?

查看:108
本文介绍了如何在更新面板外更新gridview?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hii,



我在使用modelpopup扩展程序中的更新面板后添加,我想刷新页面上显示的网格视图。我的弹出窗口显示在gridview的行命令上它自己,在弹出窗口中我也使用了更新面板,但是当我保存在modepl弹出窗口中的值时,它会存储在db上,但不是我的gridview得到刷新

Hii,

I am using update panel inside modelpopup extender , after adding that i want to refresh my gridviews which is present on page . my popup gets displayed on row command of gridview it self , in that popup i have used update panel as well , but when i save values which are their on modepl popup , it gets stored on db but not my gridview gets refreshed

推荐答案

你想要做的是你的模态弹出窗口声明一个像这样的OnOkScript ......



< asp :modalpopupextender onokscript =EditOkScript()xmlns:asp =#unknown>



然后创建一个这样的按钮...



< asp:button id =_ refreshGridPopupButtonrunat =servertext =Refreshstyle =display:noneclientidmode =Staticonclick =_ refreshGridPopupButton_Click> <原始页面上的


...



然后在EditOkScript函数中执行类似这样的操作...



what you want to do is in your modal popup declare a OnOkScript like this...

<asp:modalpopupextender onokscript="EditOkScript()" xmlns:asp="#unknown">

then create a button like this...

<asp:button id="_refreshGridPopupButton" runat="server" text="Refresh" style="display: none" clientidmode="Static" onclick="_refreshGridPopupButton_Click">

on your original page...

then in the EditOkScript function do something like this...

function EditOkScript()
        {
            var button =


ge t(' _ refreshGridPopupButton');
button.click();
}
get('_refreshGridPopupButton'); button.click(); }





然后在你的_refreshGridPopupButton按钮的OnClick事件上编写代码来设置你的gridview数据源并调用DataBind( )方法,然后你的设置...



希望这有帮助......



then on the OnClick event for your _refreshGridPopupButton button write the code to set your gridview datasource and call the DataBind() method and then your set...

Hope this helps....


这篇关于如何在更新面板外更新gridview?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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