ajax回发后html控件消失

发布于 2025-01-07 05:33:32 字数 378 浏览 2 评论 0原文

我使用 jqueryRadPanelBar 上动态生成 Div。在页面加载时它工作正常。但是,如果我折叠并展开 RadPanelBar ,生成的 div 就会从中消失。

这就是我注册脚本的方式:

ClientScript.RegisterStartupScript(this.GetType(), "GetLayout", "GetLayout('" + j + "');", true);

其中 j 是用于绘制 div 的参数数组。

可以请一些建议吗?

I'm generating the Div's dynamically on the RadPanelBar using jquery. On the page load it works fine. However, if I collapse and expand the RadPanelBar the generated divs are disappears from it.

This is how I'm registering the script:

ClientScript.RegisterStartupScript(this.GetType(), "GetLayout", "GetLayout('" + j + "');", true);

where j is a array of parameters to draw div.

Could some on please advice on it?

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

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

发布评论

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

评论(2

场罚期间 2025-01-14 05:33:32

您可以使用 OnClientItemClicked 事件,然后重绘内容。您需要将参数保存在客户端上才能实现此目的。

您可以将其包装在 RadAjaxPanel 中并强制回发,然后添加 ResponseScript 然后执行您的 GetLayout 方法。

You could possibly OnClientItemClicked event, and then redraw the content. You would need to have the parameters already saved on the client in order for this to happen.

You could wrap it in a RadAjaxPanel and force a postback, and then add a ResponseScript to then execute your GetLayout method.

淡莣 2025-01-14 05:33:32

如果你想保留你的 div,你需要做以下两件事之一。
1>将它们保留在客户端的隐藏控件中或服务器后面的某个位置
2>调用 Ajax 管理器时不刷新面板。
当您刷新 ajax 管理器时,面板将返回到开始状态。

If you want to keep your divs,you are going to need to one of 2 things.
1>Persist them in a hidden control on the client or somewhere back in the server
2> Not refresh the panel when you call the Ajax Manager.
When you refresh the ajax manager, the panel goes back to start.

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