InterviewSolution
| 1. |
How To Load Local Html Files Using Web View Control In Windows 10 Uwp App. |
|
Answer» WEBVIEW control LOADS the html content from the application’s PACKAGE USING ms-appx-web:// using network http/https. We can load the html in three ways using Source property, using NAVIGATE method and using NavigateToString. //Load local file using 'Source' property WebBrowserName.Source = new Uri("ms-appx-web:///HTMLPage.html"); //Load local file using 'Navigate' method WebBrowserName.Navigate(new Uri("ms-appx-web:///HTMLPage.html")); //Load html string using 'NavigateToString' method WebBrowserName.NavigateToString("<Html><Body><h1>Load local html string in windows phone winrt app.<h1><Body></Html>"); WebView control loads the html content from the application’s package using ms-appx-web:// using network http/https. We can load the html in three ways using Source property, using Navigate method and using NavigateToString. //Load local file using 'Source' property WebBrowserName.Source = new Uri("ms-appx-web:///HTMLPage.html"); //Load local file using 'Navigate' method WebBrowserName.Navigate(new Uri("ms-appx-web:///HTMLPage.html")); //Load html string using 'NavigateToString' method WebBrowserName.NavigateToString("<Html><Body><h1>Load local html string in windows phone winrt app.<h1><Body></Html>"); |
|