简体   繁体   English

jQuery FancyBox停止ASP.NET注销链接的工作

[英]jQuery FancyBox stopping ASP.NET Logout link from working

I am using the FancyBox jQuery plugin (http://fancybox.net/) in my ASP.NET website and have hit a small but annoying issue. 我在ASP.NET网站中使用了FancyBox jQuery插件(http://fancybox.net/),但遇到了一个小问题,但很烦人。

The site uses the default ASP.NET login controls and then displays some links which pop open a form in a FancyBox - all this works great. 该网站使用默认的ASP.NET登录控件,然后显示一些链接,这些链接会在FancyBox中弹出打开表单-所有这些都很好用。 If I do not click any of the FancyBox links and then hit the logout link (provided by the LoginStatus control) again everything works as it should. 如果我没有单击任何FancyBox链接,然后单击注销链接(由LoginStatus控件提供),则一切都会正常进行。

However if I click on one of the FancyBox links and then close it the logout link no longer works, nothing happens at all - it would appear as if the postback is not firing for some reason. 但是,如果我单击FancyBox链接之一,然后将其关闭,则注销链接不再起作用,则什么也没有发生-好像回发由于某种原因未触发。

I have done some searching but not come across anyone with a similar issue - has anyone seen this issue before? 我已经进行了一些搜索,但没有遇到类似问题的人-有人见过这个问题吗?

Thanks in advance 提前致谢

UPDATE: With a little help from IE debugger I have tracked the problem down to a JavaScript error here - 更新:在IE调试器的一点帮助下,我已将问题归结为JavaScript错误-

function __doPostBack(eventTarget, eventArgument) {
if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
    theForm.__EVENTTARGET.value = eventTarget;
    theForm.__EVENTARGUMENT.value = eventArgument;
    theForm.submit();
}

More specifically on the line that sets the eventtarget and the error I recieve is - 更具体地说,在设置eventtarget和我收到的错误的那一行是-

SCRIPT5007: Unable to set value of the property 'value': object is null or undefined SCRIPT5007:无法设置属性“值”的值:对象为null或未定义

UPDATE 2: I have put a temporary fix in place - basically I just hook into the onClosed event and reload the page at that point - 更新2:我已经放置了一个临时修复程序-基本上,我只是挂接到onClosed事件并在那时重新加载页面-

$("#form_popup").fancybox({ 
'scrolling': 'no', 
'titleShow': true, 
'onClosed' : function() { 
    location.reload(); 
} });

Of course the problem is the page will be fully reloaded from scratch missing the point of using jQuery but at least it works! 当然,问题在于页面将完全从头开始完全重新加载,缺少使用jQuery的意义,但至少可以正常工作!

For anyone who has the same problem I fixed this with this hack 对于有相同问题的任何人,我都使用此黑客解决了这个问题

$("#form_popup").fancybox({ 
 'scrolling': 'no', 
 'titleShow': true, 
 'onClosed' : function() { 
 location.reload(); 
} });

So the page gets reloaded whenever the close button is pushed which fixes the problem. 因此,只要按了关闭按钮,就可以重新加载页面,从而解决了该问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM