title: include static JS and CSS WebBrowser control
body: <p>I'm trying to include js and css resource files that are local to my project on an html page loaded as a string into a WPF WebBrowser control.</p>
  
  <p>The project builds a dll for a desktop application.  Using Visual Studio 2013 and C#.</p>
  
  <p>The HTML loads in the the WebBrowser, but I get errors related to including the JS file.</p>
  
  <pre><code>    private void Window_Loaded(object sender, RoutedEventArgs e)
      {
          string page = GetPage();
          if (page != null)
          {
              string resourcePath = System.IO.Path.GetFullPath("Resources/");
  
              //  Try setting an absolute path
              page = page.Replace("Resources/", resourcePath);
              this.webbrowser.NavigateToString(page);
          }
      }
  </code></pre>
  
  <p>Embedded within the html string is the following:</p>
  
  <pre><code>&lt;head&gt;
      &lt;script language="JavaScript" src="Resources/myscript.js"&gt;&lt;/script&gt; 
      &lt;link rel="stylesheet" type="text/css" href="Resources/mystyle.css"&gt; 
  &lt;/head&gt;
  </code></pre>
  
  <p>I get an error popup like:</p>
  
  <pre><code>An error has occurred in the script on this page.
  
  URL:  aboutC:\MyDir\MyProject\bin\Debug\Resources/myscript.js
  </code></pre>
  
  <p>It prepends "about" to the URL.  I probably also need to change the slashes.
  I tried a number of things.  "about" is always prepended.</p>
  
  <p>Also tried using IsolatedStorage, but that doesn't work for my project:
  <a href="http://msdn.microsoft.com/library/windows/apps/ff431811(v=vs.105).aspx" rel="nofollow">http://msdn.microsoft.com/library/windows/apps/ff431811(v=vs.105).aspx</a></p>