简体   繁体   English

asp.net jquery fancybox->通过codebehind关闭fancybox

[英]asp.net jquery fancybox -> Close fancybox via codebehind

Ok, so I have seen this solution to closing a fancybox via a button click. 好的,所以我已经看到了通过单击按钮关闭fancybox的解决方案。 :

$.fancybox.close(); $ .fancybox.close();

Is there a way that any one is aware of that a fancybox can be closed from the codebehind. 有没有一种方法可以使任何人都知道可以从背后的代码中关闭一个花式框。

The only thing I can think of is registering a script, because in my situation I need to perform a bunch of logic in my codebehind upon a button click event and then once that has finished close the fancybox. 我唯一能想到的就是注册一个脚本,因为在我的情况下,我需要在按钮单击事件之后在代码背后执行一堆逻辑,然后在完成后关闭fancybox。 I have searched all over and have been unable to find a solution. 我到处搜索,一直找不到解决方案。

If anyone has found a way to do this please let me know. 如果有人找到了解决方法,请告诉我。

Thanks. 谢谢。

尝试:

ScriptManager.RegisterStartupScript(this, GetType(), "" , "$.fancybox.close();", true);

I actually found an answer to my question. 我实际上找到了我问题的答案。 Thanks for the replies. 感谢您的答复。 Royi, I think you were going down the right path but your solution created errors within my application. Royi,我认为您的发展方向正确,但是您的解决方案在我的应用程序中造成了错误。 This was exactly what I was thinking about doing. 这正是我正在考虑做的事情。 My application stated that it was unable to find the type of fancybox due to some proprietary code in my application I believe. 我的应用程序指出,由于我相信我的应用程序中存在一些专有代码,因此无法找到fancybox的类型。

Here is a solution that I found that worked right off the bat. 这是我发现立即可行的解决方案。

http://forums.asp.net/t/1640878.aspx/3/10 http://forums.asp.net/t/1640878.aspx/3/10

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

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