title: Calling a function from public static class
body: <p>I am new to ASP.NET.</p>
  
  <p>I really need help on this one since I am stuck.  I've done a lot of reading on google and couldn't figure what I did wrong.</p>
  
  <blockquote>
    <p>Error: CS0103: The name 'MyClass' does not exist in the current context</p>
  </blockquote>
  
  <p>I have a MyClass.cs file, which I like to reuse that function in this file on any pages.</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Web;
  
  namespace MyNameSpace
  {
      public static class MyClass
      {
  
          //
          // TODO: Add constructor logic here
          //
  
          public static string FormatDateNoTime(string input)
          {
              string thedate;
              DateTime strDate = DateTime.Parse(input);
              thedate = strDate.ToString("MM/dd/yyyy");
              return thedate;
          }
  
          public static string test()
          {
              return "1234";
          }
  
      }
  }
  </code></pre>
  
  <p>Another Page2.aspx.cs call this function, but err</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Web;
  using System.Web.UI;
  using System.Web.UI.WebControls;
  using System.Configuration;
  using System.Data.SqlClient;
  using System.Data;
  
  using MyNameSpace;
  
  public partial class _Default : System.Web.UI.Page
  {
      protected void Page_Load(object sender, EventArgs e)
      {
          Response.Write(MyClass.FormatDateNoTime("02/01/2012"));
      }
  }
  </code></pre>
  
  <p>Can someone plese help, I simply just want to reuse this function in any pages.</p>