ajax回发后html控件消失
我使用 jquery
在 RadPanelBar
上动态生成 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 div
s 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以使用 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.
如果你想保留你的 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.