title: OutputStream is not available when a custom TextWriter is used mvc
body: <p>Im trying to get a chart on my view and I´m displaying it like this in my view:</p>
  
  <pre><code>&lt;asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server"&gt;
  
  &lt;h2&gt;ChartResult&lt;/h2&gt;
  
  &lt;% using (Html.BeginForm("HandleChartType", "Chart")) %&gt;
  &lt;% { %&gt;
  
      &lt;%= Html.DropDownList("ListItems", "Select Chart Type")%&gt;
  
      &lt;input type="submit" value="Set Chart" /&gt;
   &lt;%} %&gt;
  
  
  
  
  &lt;% myChart.Controls.Add(ViewData["Chart"] as Chart);  %&gt;  
  &lt;asp:Panel ID="myChart" runat="server"&gt;&lt;/asp:Panel&gt;
  
  
  
  &lt;!--&lt;img src="/Chart/CreateChart" alt="" /&gt;--&gt;
  
  
  &lt;h2&gt;FormResults&lt;/h2&gt;
  
  &lt;/asp:Content&gt;
  </code></pre>
  
  <p>This line &lt;% myChart.Controls.Add(ViewData["Chart"] as Chart);  %> generates the error message OutputStream is not available when a custom TextWriter is used</p>
  
  <p>This is the code from the controller:</p>
  
  <pre><code>    public ActionResult ChartResult()
      {
  
          List&lt;string&gt; items = GetFilteredChartTypes();
          ViewData["ListItems"] = new SelectList(items);
  
          Chart myChart = CreateChart(SeriesChartType.Column);
          ViewData["Chart"] = myChart;
  
          return View();
      }
  </code></pre>
  
  <p>The CreateChart function just creates a chart with Column as chart type.
  Why do I get this error, OutputStream is not available when a custom TextWriter is used?</p>