Articles → LIGHT SWITCH 2011 → Open A Link In New Browser Window In Lightswitch 2011

Open A Link In New Browser Window In Lightswitch 2011






Software Requirement




  1. Visual studio 2010 is installed on your machine.
  2. Visual Studio 2010 service pack 1 is installed on your machine.
  3. Microsoft Visual Studio Light switch 2011 is installed on your machine.

Prerequisite Knowledge


  1. What is lightswitch?
  2. How to create buttons?
  3. What is Execute() method of button?
  4. What is HTML DOM?
  5. What is dispatcher and why we use it?
  6. How to create lightswitch screens?

Assembly Required





Namespace Required




  1. Microsoft.LightSwitch.Threading
  2. System.Windows.Browser

What Is Htmlpage Class?





Implementation


Dispatchers.Main.BeginInvoke(() = >{
	var uri = new Uri("http://google.com", UriKind.RelativeOrAbsolute);
	HtmlPage.Window.Navigate(uri, "_blank");
});









Running The Code Without Dispatcher





Output


Picture showing the output of opening a link in new browser window in Lightswitch
Click to Enlarge


Posted By  -  Karan Gupta
 
Posted On  -  Monday, May 21, 2012

Query/Feedback


Your Email Id
 
Subject
 
Query/FeedbackCharacters remaining 250