JQuery Facebox 插件:将其获取到表单标签内
我想使用 JQuery 的 Facebox 插件,但在让它按照我想要的方式运行时遇到一些问题。 容纳 Facebox 内容的 div 是在标签外部创建的,因此即使我加载了一些 Web 控件,它们也不会返回到服务器。
有没有人处理过这个问题可以给我一些指示?
I am wanting to use the Facebox plugin for JQuery but am having a few issues getting it running how I want. The div that houses the facebox content is created outside of the tag so even though I am loading up some web controls none of them are firing back to the server.
Has anyone dealt with this that can give me some pointers?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
浏览 Facebox.js 我在函数 init(settings) 中遇到了这一行...
我将其更改为...
并且它加载到表单标签中,尚不确定是否有任何副作用
poking around the facebox.js I came across this line in the function init(settings)...
I changed that to ...
and it loads up in the form tag, not sure yet if there are any side effects
您可以使用此代码来注册 PostBack 事件:
这将使按钮触发 PostBack。
You can use this code to register the PostBack event:
this will let the button fires a PostBack.
即使在之后:
$('#aspnetForm').append($.facebox.settings.faceboxHtml)
更改我发现它有问题。 当您使用 firebug 查看页面源代码时,您会发现分配给 Facebox div 的 div 中的所有 html 都被加倍(重复)。
因此,所有这些具有假定唯一 id 的控件都会在页面上加倍,这在回发时效果不佳,我决定将 ASP.NET Web 控件放入 Facebox 中不是一个好主意。
Even after the :
$('#aspnetForm').append($.facebox.settings.faceboxHtml)
change I found it problematic. When you look at the page source using firebug you see that all the html in the div assigned to be the facebox div is doubled up (repeated).
So all of those controls with supposed unique id's are doubled up on the page, that can't be good on the postback, i've decided putting asp.net web controls in a facebox is not a good idea.
我修改了 facbox.js 来做到这一点。 也许有更好的解决方案,但这就像一个魅力,
我做了什么:
I modified facbox.js to do this. Maybe there is a better solution but this works like a charm
Here what i did: