title: How to get reference of DropDownList into codebehind?
body: <pre><code>&lt;asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"  Onrowupdating="GridView1_RowUpdating" onrowediting="GridView1_RowEditing"&gt;
      &lt;Columns&gt;
          &lt;asp:TemplateField HeaderText="Test"&gt;
              &lt;EditItemTemplate&gt;
                  &lt;asp:UpdatePanel ID="up1" runat="server" UpdateMode="Conditional"&gt;
                      &lt;ContentTemplate&gt;
                          &lt;asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True" 
                              OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged"&gt;
                              &lt;asp:ListItem&gt;Test1&lt;/asp:ListItem&gt;
                              &lt;asp:ListItem&gt;Test2&lt;/asp:ListItem&gt;
                              &lt;asp:ListItem&gt;Test3&lt;/asp:ListItem&gt;
                          &lt;/asp:DropDownList&gt;
                      &lt;/ContentTemplate&gt;
                  &lt;/asp:UpdatePanel&gt;
              &lt;/EditItemTemplate&gt;
              &lt;ItemTemplate&gt;
                  &lt;asp:Label ID="Label1" runat="server" Text='&lt;%# Bind("SS") %&gt;' /&gt;
              &lt;/ItemTemplate&gt;
          &lt;/asp:TemplateField&gt;
          &lt;asp:TemplateField HeaderText="Rate"&gt;
              &lt;EditItemTemplate&gt;
                  &lt;asp:UpdatePanel ID="up2" runat="server" UpdateMode="Conditional"&gt;
                      &lt;ContentTemplate&gt;
                          &lt;asp:DropDownList ID="DropDownList2" runat="server" /&gt;
                      &lt;/ContentTemplate&gt;
                  &lt;/asp:UpdatePanel&gt;
              &lt;/EditItemTemplate&gt;
              &lt;ItemTemplate&gt;
                  &lt;asp:Label ID="Label2" runat="server" Text="Label" /&gt;
              &lt;/ItemTemplate&gt;
          &lt;/asp:TemplateField&gt;
          &lt;asp:CommandField ShowEditButton="True" /&gt;
      &lt;/Columns&gt;
  &lt;/asp:GridView&gt;
  </code></pre>
  
  <p>How to get reference of <code>DropDownList2</code> in <code>DropDownList1_SelectedIndexChanged</code> when grid is in edit mode?</p>