Geeks With Blogs

Michael Freidgeim's Blog MS .Net Development March 2010 Entries
JavaScript function to Redirect parent of IFrame to specified URL
/// <summary> /// Redirects parent of IFrame to specified URL /// If current page doesn't have parent, redirect itself /// </summary> /// <param name="page"></param> /// <param name="url"></param> public static void NavigateParentToUrl(Page page, string url) { String script = @" try { var sUrl='" + url + @"'; if (self.parent.frames.length != 0) self.parent.location=sUrl; else self.location = sUrl; } catch (Exception) {} "; page.ClientScript.RegisterS... ......

Posted On Friday, March 19, 2010 6:34 AM

Copyright © Michael Freidgeim | Powered by: GeeksWithBlogs.net | Join free