title: Terminate if statement without terminating child code
body: <p>I have a page which acts as both a viewing page and an edit page. Obviously for security I only want users to access the edit functionality if they are authorised. In order to submit the edited data to the server, I've wrapped a form around the page with the <code>Html.BeginForm</code> method. My problem is that I need to only create that form if the user is authorised. Here is my code:</p>
  
  <pre><code>if(UserIsAuthorised)
  {
      using(Html.BeginForm("update","page"))
      {
          //Code that happens regardless of whether or not the user is authorised
      }
  }
  </code></pre>
  
  <p>By wrapping the whole thing in an <code>if</code> statement, it means the entire page is blank unless the user is authorised, which is not how it should be. Any user should be able to view the page, but only authorised users can view it.</p>
  
  <p>I know I could just write out the <code>form</code> tags manually but I was hoping there was an easier way
  Hopefully this is clear enough.</p>