I created a fancy box. It has a button like this -
onclick="parent.$.fancybox.close();" />
When the user clicks on 'Cancel' it calls - "parent.$.fancybox.close();".
But, I want to call "parent.$.fancybox.close();" from my C# code (code behind).
Any clue

Dorababu MekaRank #457 · 5.5K reputationPosted Sep 27, 2012, 4:08 AM EDT
ScriptManager.RegisterStartupScript(this, GetType(), "" , "$.fancybox.close();", true);
r pRank #4,639 · 333 reputationPosted Sep 27, 2012, 5:23 AM EDT
It does not work for me when I use it within "User Control" (.ascx). My facybox code is in a control called - MyFancyControl.ascx and I use it with in a page called - MyFancyDisplyPage.aspx; then I call the display page from MyFancyCALLERPage.aspx.
If I move the entire code to a page instead of keeping it in a control, ScriptManager.RegisterStartupScript(this, GetType(), "" , "$.fancybox.close();", true); will work.
How can I close fancybox from a user control (.ascx)?
Thanks
Sergio Airapetian2 reputationPosted Oct 31, 2012, 7:34 AM EDT