Reputation: 35
I am using webview in my project. And i want to load some css,js files from local(forexample jquery or bootstrap files, or custom..)
Anyway,
This is my folders in solution explorer
And this code is what i am using for sample..
private async void NavigationHelper_LoadState(object sender, LoadStateEventArgs e)
{
webViewFormResponse.NavigateToString(" " +
"<html><head><link rel='stylesheet' href='ms-appx-web:///css/mobileview.css' type='text/css' media='screen' /></head>" +
"<input type='text' value='testt'>" +
"</html>");
}
I am using ms-appx-web:///, But css not loading. What is my wrong?
Upvotes: 1
Views: 600
Reputation: 2275
You can't use NavigateToString in this way. You will have to use WebView.NavigateToLocalStreamUri to load local CSS. Please see my blog post for some good information on this:
Upvotes: 1