title: How do I properly declare namespaces in my aspx page?
body: <p>I cannot seem to add namespaces to my .aspx page without getting "A namespace cannot directly contain members such as fields or methods". The header of my aspx project is set up like so:</p>
  
  <pre><code>&lt;%@ Page Language="C#" %&gt;
  &lt;%@ Import Namespace="System.Data.SqlClient;"%&gt;
  &lt;%@ Import Namespace="System.IO;"%&gt;
  &lt;%@ Import Namespace="System.Net.Mail;"%&gt;
  &lt;%@ Import Namespace="System.Text;"%&gt;
  &lt;%@ Import Namespace="System.Web;"%&gt;
  &lt;%@ Import Namespace="System.Linq;"%&gt;
  &lt;%@ Import Namespace="System.Web.Security;"%&gt;
  &lt;%@ Import Namespace="System.Web.UI;"%&gt;
  &lt;%@ Import Namespace="System.Web.UI.WebControls;"%&gt;
  &lt;%@ Import Namespace="System.Web.UI.WebControls.WebParts;"%&gt;
  &lt;%@ Import Namespace="System.Web.UI.HtmlControls;"%&gt;
  &lt;!DOCTYPE html&gt;
  
  &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
  &lt;head runat="server"&gt;
  &lt;title&gt;&lt;/title&gt;
  
  &lt;/head&gt;
  &lt;body&gt;
  &lt;script runat="server"&gt;
  protected void Page_Load(object sender, EventArgs e)
      {
          lblDate.Text = DateTime.Now.ToString();
      }
  //more functions
  </code></pre>
  
  <p>I did do a google search which lead me back <a href="https://stackoverflow.com/questions/2090369/error-a-namespace-does-not-directly-contain-members-such-as-fields-or-methods">here</a>. This talks about finding your app.config file. Well, my project has no app.config, when I try to add one in VS2012 its not even listed as an option. 
      </p>