1 out of 2 rated this helpful - Rate this topic

WebBrowser Control Overview for Windows Phone

Windows Phone

March 22, 2012

Windows Phone provides a WebBrowser control that is based on the Silverlight desktop version, with a few differences. For more information about these differences, see Differences Between the Desktop and Device WebBrowser Controls for Windows Phone.

The WebBrowser control can be embedded into an application and used for a number of reasons including, but not limited to, the following:

  • Displaying web content from the network. You can build an application that is composed solely of an embedded WebBrowser control that points to your website, with custom branding around the outside of the control.

  • Displaying static web content. You can configure an application to save content locally in isolated storage and then view it later in an embedded WebBrowser control.

  • Displaying dynamically-generated web content. You can point the WebBrowser control at HTML content that is constructed dynamically in the application code.

Memory allocated for a WebBrowserTask does not count toward total application memory use. If you are developing your application to target a 256-MB device, consider using a Web Browser Task instead of a WebBrowser control. This helps minimize your application's memory use, which is particularly important when your application runs on a 256-MB device. For more information, see Developing for 256-MB Devices and How to: Use the Web Browser Task for Windows Phone

Caution noteCaution:

Script is disabled in the WebBrowser control by default. Set the IsScriptEnabled property to true if you want to enable scripting in your control.

Caution noteCaution:

When creating a WebBrowser control in XAML, you must specify a value for the Name attribute for that control so that the Windows Phone Capability Detection Tool can properly detect and grant the right capabilities for your application. For more information about the Windows Phone Capability Detection Tool, see How to: Determine Application Capabilities.

You can also use the GetCookies(WebBrowser) method of the WebBrowserExtensions class to retrieve a collection of cookies from a website that you can use in future web requests.

To view a sample application that uses the WebBrowser control, see How to: Create Your First Silverlight Application for Windows Phone.

Did you find this helpful?
(1500 characters remaining)