CodePaste Logo
New Snippet New Recent Snippets Recent Snippets My Snippets My Snippets My Favorites Favorites Web Code Search Snippets Search
Sign inor Register
Language: csharp

JavaScript location.href Vs. Silverlight HtmlPage.Window.Navigate

3981 Views   
private const string blankTarget = "_blank"; private const string selfTarget = "_self"; /// <summary> /// Open html page specified by Uri in specified target. /// </summary> /// <param name="uri"></param> /// <param name="target">"_blank", "_self", "_top", "_parent", window or frame name.</param> private static void openHtmlPage(Uri uri, string target) { if (String.Equals(target, selfTarget)) { HtmlPage.Window.Eval(String.Format("window.location.href='{0}';", uri)); } else { HtmlPage.Window.Navigate(uri, target); // TODO: Check on "_blank" target if pop up is allowed. // if (HtmlPage.IsPopupWindowAllowed) ... } }
by Danijel Stulic
  August 11, 2009 @ 9:22am
Tags:
Add a comment


Report Abuse
brought to you by:
West Wind Techologies