title: Using a Razor @functions in several webpages (.cshtml files)
body: <p>I have the below function that I would like to be available to several .cshtml views in my asp.net web pages 2 application. How can I make this function available to any view in the application (as opposed to just one).</p>
  
  <pre><code>@functions {
  
      public bool DisplayButton(String startDate, String endDate)
      {
          return Convert.ToDateTime(startDate) &lt; DateTime.Now &amp;&amp; Convert.ToDateTime(endDate) &gt; DateTime.Now;
      }
  }
  </code></pre>