How to use App_code classes in .aspx
<p>I tried to import a App_Code class in aspx page by pasting the following line in aspx page.
&lt;%@ Import Namespace = "LoginBox" %>, where LoginBox is the namespace of the class in App_Code.
But this throws me 'Statement cannot appear outside of a method body/multiline lambda' error.
Can anyone guide me of how to fix this error.</p>

<p>For your reference:
App_code folder contents - login.cs</p>

<pre><code>using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.IO;

/// &lt;summary&gt;
/// Summary description for login
/// &lt;/summary&gt;
///
namespace LoginBox
{
    public class login
    {
      public login()
      {
        string myFile = "includes/status.txt";
        FileStream fileStream = new FileStream(myFile, FileMode.Open);
        StreamReader sr = new StreamReader(fileStream);
        string theData = sr.ReadToEnd();
        int status = Convert.ToInt16(theData);
        if (status == 0)
        {
          //code goes here
        }
        else if (status == 1)
        {
          //code goes here
        }
      }
    }
}
</code></pre>

<p>Thanks.</p>
