Jayasri
Jayasri

Reputation: 235

Html page in windows phone8.1

How to call Html page in windows phone8.1 using webview my xaml code is:

<StackPanel>
    <WebView x:Name="myWebView"
             Height="550"
             VerticalAlignment="Top"
             Source="ms-appx:///html/Home.html" />
    <TextBox Margin="10,95,124,0"
             VerticalAlignment="Top"
             Text="ms-appx:///html/Home.html" />
</StackPanel>

I created file name Home.html inside I used .js and .css styles and .cs code:

var html = await Windows.Storage.PathIO.ReadTextAsync("ms-appx:///html/Home.html");
this.myWebView.NavigateToString(html);

But its not working? If someone have idea of this help me.

Upvotes: 2

Views: 48

Answers (1)

Kai Brummund
Kai Brummund

Reputation: 3568

To access resources from within WebView, you have to use the ms-appx-web:// protocol.

(Only for your .css etc. Files. Not for the direct loading you do before using NavigateToString.)

Upvotes: 1

Related Questions