如何刷新 fancybox 弹出窗口?

发布于 2025-01-03 20:49:02 字数 902 浏览 4 评论 0原文

在此处输入代码我有一个 fancybox 弹出窗口,其中包含城市列表和一个文本框。一旦用户在文本框中输入另一个城市名称并单击“保存”,我就可以将新城市保存到数据库中,但如何才能重新加载弹出窗口,以便新城市也出现在列表中? 我的弹出窗口是一个 ASPX 页面,我所要做的就是以某种方式执行 Page_Load 事件,以便它显示包含所有城市的数据网格。

我有什么办法可以做到这一点吗?以某种方式重新加载弹出窗口?请帮忙!!!

这是打开我的弹出窗口的 fancybox 代码:

$(document).ready(
                function () {
                    $("#location").fancybox({
                        onClosed: function () {
                            __doPostBack('BodyContent', '');
                        },
                        ajax : {
                        'cache': false,
                        'titlePosition': 'inside',
                        'overlayShow': true,
                        'overlayColor': '#000',
                        'transitionIn': 'elastic',
                        'transitionOut': 'elastic'
                      }
            });

        });  

enter code hereI have a fancybox popup that has the list of cities on it, and a textbox. Once a user enters another city name into the textbox and clicks "Save", I am able to save the new city into the database, but how can I also reload just the popup, so that the new city appears in the list as well?
My popup is an ASPX page, and all I would have to do is somehow execute the Page_Load event, so that it would display the datagrid with all the cities.

Is there any way I can do that? Somehow reload the popup? PLEASE HELP!!!

Here is the fancybox code that opens my popup:

$(document).ready(
                function () {
                    $("#location").fancybox({
                        onClosed: function () {
                            __doPostBack('BodyContent', '');
                        },
                        ajax : {
                        'cache': false,
                        'titlePosition': 'inside',
                        'overlayShow': true,
                        'overlayColor': '#000',
                        'transitionIn': 'elastic',
                        'transitionOut': 'elastic'
                      }
            });

        });  

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

橘和柠 2025-01-10 20:49:02

如果我理解得很好,您应该这样做:在关闭弹出窗口时执行的服务器事件中,确保重新绑定网格(向其提供更新的数据并再次调用其 DataBind 方法。

If I understood well, you should do this: within the server event that gets executed when you close the popup, make sure that you rebind the grid (feed it with the updated data and call its DataBind method again.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文