title: GridView must be placed inside a form tag with runat="server" even after the GridView is within a form tag
body: <pre><code>&lt;form runat="server" id="f1"&gt;
      &lt;div runat="server" id="d"&gt;
          grid view:
          &lt;asp:GridView runat="server" ID="g"&gt;
          &lt;/asp:GridView&gt;
      &lt;/div&gt;
  
      &lt;asp:TextBox runat="server" ID="t" TextMode="MultiLine" Rows="20" Columns="50"&gt;&lt;/asp:TextBox&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>Code behind:</p>
  
  <pre><code>public partial class ScriptTest : System.Web.UI.Page
  {
      protected void Page_Load(object sender, EventArgs e)
      {
          g.DataSource = new string[] { "a", "b", "c" };
          g.DataBind();
  
          TextWriter tw = new StringWriter();
          HtmlTextWriter h = new HtmlTextWriter(tw);    
          d.RenderControl(h);
          t.Text = tw.ToString();
      }
  }
  </code></pre>
  
  <p>Even the GridView is within a from tag with runat="server", still I am getting this error.</p>
  
  <p>Any clues please ?</p>