title: Accessing a view's function from another view
body: <p>Firstly, I'm beginner of the MVC.</p>
  
  <p>I have a controller named <code>FinanceController</code>. I have two views named <code>StoreEvaluationForm</code> and <code>SendStoreEvaluationToPdf</code> of this control. I want to call a first view's <code>public static</code> function, which is defined in <code>@functions</code>, from second view. </p>
  
  <p>I guess views have hidden class in mvc. Because I realized when I mouse over first view's function, VS shows its class named <code>_Page_Views_Finance_StoreEvaluationForm_cshtml</code> and its namespace named ASP. However I couldn't find any way to accessing another view's function. In second view ASP namespace has only its class named <code>_Page_Views_Finance_SendStoreEvaluationToPdf_cshtml</code>.</p>
  
  <p>To be clear, function in the view is a C# function not a javascript function. Its definition is:</p>
  
  <pre><code>@functions
  {
      public static string NumberFormatter(double? number, bool percent = false)
      {
          return number == null ? null : string.Format("{0}{1}", number.Value.ToString("N2"), percent ? "%" : null);
      }
  }
  </code></pre>