title: nested child gridview name does not exist in this context
body: <p>So I have created a gridview and inside it I have given another gridview.</p>
  
  <pre><code>&lt;asp:GridView ID="dgInstitute" runat="server" AutoGenerateColumns="False" CellPadding="0"
      CellSpacing="0" ShowHeaderWhenEmpty="True" PageSize="100" Width="100%" CssClass="table table-responsive table-bordered"
      Visible="true" UseAccessibleHeader="true" OnRowCreated="dgInstitute_RowCreated"
      OnDataBound="dgInstitute_DataBound" OnRowDataBound="dgInstitute_RowDataBound"&gt;
      &lt;Columns&gt;
          &lt;asp:BoundField HeaderText="Id" DataField="refGroupId" HeaderStyle-HorizontalAlign="Left" HeaderStyle-CssClass="gridHeader panel-default"&gt;&lt;/asp:BoundField&gt;
          &lt;asp:TemplateField HeaderStyle-CssClass="gridHeader panel-default"&gt;
              &lt;ItemTemplate&gt;
  
                  &lt;asp:GridView ID="dgProgram" runat="server" AutoGenerateColumns="False" CellPadding="0"
                      CellSpacing="0" ShowHeaderWhenEmpty="True" PageSize="100" Width="100%" CssClass="table table-responsive table-bordered"
                      Visible="true" UseAccessibleHeader="true" OnRowCreated="dgProgram_RowCreated" OnDataBound="dgProgram_DataBound"&gt;
                      &lt;Columns&gt;
                          &lt;asp:BoundField HeaderText="Id" DataField="refGroupId" HeaderStyle-HorizontalAlign="Left" HeaderStyle-CssClass="gridHeader panel-default"&gt;&lt;/asp:BoundField&gt;
                          &lt;asp:TemplateField HeaderStyle-CssClass="gridHeader panel-default" ShowHeader="false"&gt;
                              &lt;ItemTemplate&gt;
                                  &lt;asp:Button AutoPostBack="true" Width="300px" CssClass="btn btn-primary btn-embossed" ID="btnProgram" runat="server"
                                      Text='&lt;%#Eval("refValues") %&gt;'
                                      OnClick="btnProgram_Click" CommandArgument='&lt;%#Eval("refGroupId") %&gt;' /&gt;
  
                                  &lt;div class="voffset3"&gt;&lt;/div&gt;
                              &lt;/ItemTemplate&gt;
                          &lt;/asp:TemplateField&gt;
                      &lt;/Columns&gt;
                      &lt;HeaderStyle CssClass="panel-default"&gt;&lt;/HeaderStyle&gt;
                      &lt;RowStyle CssClass=""&gt;&lt;/RowStyle&gt;
                  &lt;/asp:GridView&gt;
  
                  &lt;div class="voffset3"&gt;&lt;/div&gt;
              &lt;/ItemTemplate&gt;
          &lt;/asp:TemplateField&gt;
      &lt;/Columns&gt;
      &lt;HeaderStyle CssClass="panel-default"&gt;&lt;/HeaderStyle&gt;
      &lt;RowStyle CssClass=""&gt;&lt;/RowStyle&gt;
  &lt;/asp:GridView&gt;
  </code></pre>
  
  <p>For this first gridview is accessible on code behind but when I try to use secondGridview it says dgProgram name doe not exist in current context.</p>
  
  <p>I restarted my solution but didn't work.</p>