WebView.Source property

Expand
0 out of 2 rated this helpful - Rate this topic

WebView.Source property

[This documentation is preliminary and is subject to change.]

Gets or sets the Uniform Resource Identifier (URI) source of the HTML content to display in the WebView control.

Syntax


public Uri Source { get; set; }


<WebView Source="uriString"/>

Property value

Type: System.Uri [.NET] | Windows::Foundation::Uri [C++]

The URI source of the HTML content to display in the WebView control.

Requirements

Minimum supported client

Windows 8 Release Preview

Minimum supported server

Windows Server 2012

Namespace

Windows.UI.Xaml.Controls
Windows::UI::Xaml::Controls [C++]

Metadata

Windows.winmd

See also

WebView

 

 

Build date: 5/22/2012

Did you find this helpful?
(1500 characters remaining)
Community Additions ADD
RE: How to load from a local html file?

I'm fairly new on this, but did you consider the Navigate() method? http://msdn.microsoft.com/en-us/library/windows/apps/windows.ui.xaml.controls.webview.navigate.aspx#Y136

You might be able to call Navigate() in your OnNavigatedTo() function of your main page. Suppose you have a webview element named ContentView in your xaml file:

 <WebView x:Name="ContentView" .../>

Then Something like this in your BlankPage.xaml.cpp might do the trick:

void BlankPage::OnNavigatedTo(NavigationEventArgs^ e)
{

ContentView->Navigate([the URI for your source, e.g. file:///Ducuments/index.html]);

...

}

5/25/2012
Adding +1

It must be a very important feature.. my +1

also is there any possibility that some how we can refer the content from memory stream like the image source?

3/16/2012
How to load from a local html file?
Is there any way to load a web browser from a local html file? I was actually trying to load an index.html file located onto my personal computer (for instance such as: file:///Documents/index.html) and although this file's been effectively loaded into all the main browsers (included IE10 obviously) I've never managed to get it work by using a WebView yet. Is this part of any security locks embedded into a metro app or am I hopefully doing anything wrong there? Thanks
11/22/2011