Reputation: 864
Right now I am loading HTML file in webview by placing into the Assets folder(it's working fine).. if I try do like that for XHTML file it is displaying as blank in webview.
Question: Can I load XHTML file in webview in store app from local drive?
Any help needed...
Upvotes: 1
Views: 957
Reputation: 15296
Basically the problem is XHTML document does not become part of project as its build action is set to None. You have to include it. To do follow this steps.
Right click on that XHTML document & click on property.
Open combo box of property "Build Action"
It has default "None", change it to "Content"
That's it. Test and reply back. If it works, don't forget to mark it as answer.
UPDATE 1
Load XHTML from assets
MyWebView.Source = new Uri("ms-appx-web:///Assets/test.xhtml");
Load XHTML from local folder :
var XHTML = await Windows.Storage.ApplicationData.Current.LocalFolder.GetFileAsync("test.xhtml");
MyWebView.NavigateToString(await Windows.Storage.FileIO.ReadTextAsync(XHTML));
Upvotes: 2