Geeks With Blogs
Gaurav Taneja Great dreams... never even get out of the box. It takes an uncommon amount of guts to put your dreams on the line, to hold them up and say, "How good or how bad am I?" That's where courage comes in.

Javascript Function for Closing any popup window. 

 

ASPX CODE  

<script language="javascript" type="text/javascript">

    function GetRadWindow()  

        {  

            var oWindow = null;  

            if (window.radWindow) oWindow = window.radWindow;

            else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow;                  

            return oWindow;  

        }  

 

       

        function CancelEdit()  

        {  

            

            GetRadWindow().Close();

            GetRadWindow().BrowserWindow.location.reload();

            return false;                 

        }

onclick="javascript: CancelEdit();"

[u can use it on aspx as shown here or severside as shown below]

CS CODE

protected void btnClose_Click(object sender, EventArgs e)

    {

        Session[GlobalCommon.KEY_CITY_EDIT] = null;

        RadAjaxPanel1.ResponseScripts.Add("CancelEdit();");

    }

Posted on Thursday, April 3, 2008 8:04 PM Vini | Back to top


Comments on this post: Javascript Function for Closing any popup window.

# re: Javascript Function for Closing any popup window.
Requesting Gravatar...
Even Telerik support forums could not help me with this. Thanks a lot. I have been looking fot a solution to this the whole night. Thanks again.
Left by Siyabulela Mooi on Aug 21, 2010 11:04 PM

# re: Javascript Function for Closing any popup window.
Requesting Gravatar...
thank you i was missing --GetRadWindow().BrowserWindow.location.reload();

return false;
spend lot of time to figure out
Left by chandra on Sep 22, 2011 3:26 PM

# re: Javascript Function for Closing any popup window.
Requesting Gravatar...
This GetRadWindow function does not work in IE8.
Left by Craig on Feb 29, 2012 4:39 AM

Your comment:
 (will show your gravatar)


Copyright © Gaurav Taneja | Powered by: GeeksWithBlogs.net