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:
<%@ Page Language="C#" %>
<%@ Import Namespace="System.Data.SqlClient;"%>
<%@ Import Namespace="System.IO;"%>
<%@ Import Namespace="System.Net.Mail;"%>
<%@ Import Namespace="System.Text;"%>
<%@ Import Namespace="System.Web;"%>
<%@ Import Namespace="System.Linq;"%>
<%@ Import Namespace="System.Web.Security;"%>
<%@ Import Namespace="System.Web.UI;"%>
<%@ Import Namespace="System.Web.UI.WebControls;"%>
<%@ Import Namespace="System.Web.UI.WebControls.WebParts;"%>
<%@ Import Namespace="System.Web.UI.HtmlControls;"%>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
lblDate.Text = DateTime.Now.ToString();
}
//more functions
I did do a google search which lead me back here. 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.