title: Global methods in C# ASP.Net
body: <p>I´m using C# and ASP.NET for developing in Windows Azure.</p>
  
  <p>I want to do a global Method to validate fields, my idea is to do a global Method like
  (for example in Site.Master)</p>
  
  <pre><code>static Regex dateRegex = new Regex("^\\d{2}/\\d{2}/\\d{4}$");
  public boolean validate( string type, string stringToValdate)
  {
    boolean valid = NO;
    if (type = "date")
    {
        Match m = fechaRegex.Match(stringToValdate);
        if(m.Success)
        {
              valid = true;
        }
    }
  
   return valid;
  }
  </code></pre>
  
  <p>And then use it in another webform</p>
  
  <pre><code>using ????
  
  Site.Master.validate("date",TextBox1.Text);
  </code></pre>