title: How to hide or disable radiobuttonlist and textbox based on condition of another two textboxes when edit button is clicked
body: <p>I have a formview with textboxes and radiobuttonlist and edit button in the order as follows   </p>
  
  <pre><code> &lt;asp:textbox id="tb1" runat="server" text='&lt;%# Bind("DATE_1", "{0:d}") %&gt;' /&gt;
   &lt;asp:calendarextender id="tb1_CalendarExtender" runat="server" targetcontrolid="tb1" /&gt;
  
   &lt;asp:textbox id="tb2" runat="server" text='&lt;%# Bind("DATE_2", "{0:d}") %&gt;' /&gt;
   &lt;asp:calendarextender id="tb2_CalendarExtender" runat="server" targetcontrolid="tb2" /&gt;
  
   &lt;asp:button id="EditButton" runat="server" causesvalidation="False" commandname="Edit" text="Edit" enabled='&lt;%# CanEdit(Eval("DATE_1"), Eval("DATE_2")) %&gt;' OnClick="EditButton_Click" /&gt;
  
   &lt;asp:radiobuttonlist id="rbl1" runat="server" repeatdirection="Horizontal" text='&lt;%# Bind("DIAG_LL_APPROVAL") %&gt;'&gt;
        &lt;asp:ListItem&gt;Approved&lt;/asp:ListItem&gt;
        &lt;asp:ListItem&gt;Rejected&lt;/asp:ListItem&gt;
        &lt;asp:ListItem Selected="True"&gt;None&lt;/asp:ListItem&gt;
   &lt;/asp:radiobuttonlist&gt;
   &lt;asp:textbox id="tb3" runat="server" text='&lt;%# Bind("COMMENTS") %&gt;' maxlength="1000"/&gt;                                 
  </code></pre>
  
  <p>Need to hide or disable <code>rbl1</code> and <code>tb3</code> if <code>tb1</code> or <code>tb2</code> doesn't have any value (i.e <code>null</code>) when edit button is <code>clicked</code>.</p>
  
  <pre><code>protected void EditButton_Click(object sender, EventArgs e)
      {
          TextBox t1 = FormViewName.FindControl("tb1") as TextBox;
          TextBox t2 = FormViewName.FindControl("tb2") as TextBox;
          RadioButtonList rbl = FormViewName.FindControl("rbl1") as RadioButtonList;
          TextBox t3 = FormViewName.FindControl("tb3") as TextBox;
  
          //if ("".Equals(tdcd) || "".Equals(tdrcd))
          if (!string.IsNullOrEmpty(t1.Text) &amp;&amp; !string.IsNullOrEmpty(t2.Text))
          {
              FormViewName.FindControl("rbl1").Visible = true;
              FormViewName.FindControl("tb3").Visible = true;
          }
          else
          {
              FormViewName.FindControl("rbl1").Visible = false;
              FormViewName.FindControl("tb3").Visible = false;
          }
      }                                                                             
  </code></pre>
  
  <p>Error: Oject reference not set to an instance of an object</p>