title: FormView C# Toggle Image Visibility
body: <p>I have a FormView that displays a Button and an image.
  When the user clicks the linkButton, I want to show/hide the visibility of image.</p>
  
  <pre><code>&lt;asp:FormView ID="FormOptions" runat="server" CellPadding="4" DataSourceID="dsOpts" ForeColor="#333333"&gt;
  &lt;ItemTemplate&gt;
  &lt;asp:Button ID="ButtonHide" runat="server" Text='&lt;%# Eval("optDisplay")%&gt;' onclick="ButtonHide_Click"/&gt;
  &lt;asp:Image ID="ImageFP" ImageUrl='&lt;%# Eval("optImage")%&gt;' runat="server" CssClass="optImages"/&gt;
  &lt;/ItemTemplate&gt;
  &lt;/asp:FormView&gt;
  </code></pre>
  
  <p>Then in my code behind, I have:</p>
  
  <pre><code>protected void ButtonHide_Click(object sender, EventArgs e)
  {
  ImageFP.visible = false;
  }
  </code></pre>
  
  <p>However, I get an error saying it cannot find ImageFP.  This works when the image is not part of a FormView so I'm guessing I need to specify more directly the path to the image.  I'm new with Visual Basic and appreciate any guidance!</p>