Posted on: 9/3/2012 3:29:30 AM | Views : 354

using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
I can add above namespaces in .aspx file but not in my C# classes in App_Code >DAL >Class1.cs :
MY CLASS CODE :
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace WebApplication2.App_Code
{
public class Class1
{
public string name = "ali";
}
}
MY .aspx CODE:
namespace WebApplication2
{

public partial class _Default : System.Web.UI.Page
{
Class1 c1 = new Class1();
protected void Page_Load(object sender, EventArgs e)
{

}
}
}
After buildind the solution,I got :
Error 2 The type or namespace name ' ...

Go to the complete details ...