title: generate an HTML-file and display it immediately in a WebBrowser-Control in C#
body: <p>I'm trying to create a program that is intended to help my kids organize their school-stuff.
  I have a method that should read out the Week-class (containing Days which contain subjects) and convert these information to an HTML-based timetable. Unfortunately, you can check in Chrome, that it generates the HTML-code properly, but however, it does not display it.</p>
  
  <pre><code>public class TimetableViewer : WebBrowser
  {
      Week week;
  
      public TimetableViewer()
      {
          week = null;
      }
      public TimetableViewer(Week week)
      {
          this.week = week;
          this.Url = new Uri(Application.StartupPath + "\\timetable.html");
          updateView("timetable.html");
          this.Refresh(WebBrowserRefreshOption.Completely);
      }
  
      public void updateView(string path="timetable.html")
      {
          Subject[,] sub = week.toArray(); // more comfortable to work with
          StreamWriter writer = new StreamWriter(path);
          writer.WriteLine("&lt;DOCTYPE html&gt;");
          writer.WriteLine("&lt;html&gt;");
          writer.WriteLine("&lt;head&gt;");
          writer.WriteLine("&lt;/head&gt;");
          writer.WriteLine("&lt;body&gt;");
          writer.WriteLine("&lt;h2&gt;");
          writer.WriteLine("&lt;table border=\"2\"&gt;");
          writer.WriteLine("&lt;tr&gt;&lt;td&gt;Montag&lt;/td&gt;&lt;td&gt;Dienstag&lt;/td&gt;&lt;td&gt;Mittwoch&lt;/td&gt;&lt;td&gt;Donnerstag&lt;/td&gt;&lt;td&gt;Freitag&lt;/td&gt;&lt;/tr&gt;");
          for (int d = 0; d &lt; sub.GetLength(0); d++)
          {
              writer.WriteLine("&lt;tr&gt;");
              for (int s = 0; s &lt; sub.GetLength(1); s++)
              {
                  writer.WriteLine("&lt;td&gt;" + sub[d, s].getName() + "&lt;/td&gt;");
              }
              writer.WriteLine("&lt;/tr&gt;");
          }
          writer.WriteLine("&lt;/table&gt;");
          writer.WriteLine("&lt;/h2&gt;");
          writer.WriteLine("&lt;/body&gt;");
          writer.WriteLine("&lt;/html&gt;");
          writer.Close();
      }
  }
  </code></pre>
  
  <p>"Montag","Dienstag" etc. are the german names for "Monday", "Tuesday" etc. (mainly because I'm german)</p>