asp.net jquery fancybox -> Close fancybox via code

2019-07-18 14:37发布

Ok, so I have seen this solution to closing a fancybox via a button click. :

$.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. 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.

2条回答
beautiful°
2楼-- · 2019-07-18 14:43

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. 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.

Here is a solution that I found that worked right off the bat.

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

查看更多
做个烂人
3楼-- · 2019-07-18 15:04

try :

ScriptManager.RegisterStartupScript(this, GetType(), "" , "$.fancybox.close();", true);
查看更多
登录 后发表回答