Search code examples
c#windows-8microsoft-metrowindows-store

How to make web pages & put them in a Windows store C# app


Basically I want to display some html/js content in a WebView browser within my Windows Store C# app. I have been trying unsuccessfully to do this - I can get the local web page to display in a WebView - but that's it.

How do you do the following:

  1. Reference JS and CSS files within the html file loaded into the WebView - can relative urls be used in the html file to the JS and CSS ones (e.g. scripts/eg.js) or does ms-appx-web:/// have to be used (e.g. ms-appx-web:///ScriptrHTML/scripts/eg.js)?

  2. What's the best way to include html, JS and CSS resources into your project and guarantee they will be exported alongside the final app?

I couldn't find any tutorials on this, if you can I would love to see it!

Thanks in advance


Solution

    1. Yes relative references will work
    2. Make sure the Build Action for the various files is set to Content (just like the logos)