using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
namespace Bank
{
class Customer
{
public string Name;
public string Email;
public Customer(string strName,string strEmai)
{
Name=strName;
Email=strEmai;
}
}
}
namespace webSite
{
class Customer
{
public string Name;
public string Email;
public Customer(string strName,string strEmail)
{
Name=strName;
Email=strEmail;
}
}
}
namespace Test06
{
using BC = Bank.Customer;
using Wsc = webSite.Customer;
public partial class Default8 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
BC mybv = new BC("Mike", "Mike@163.com");
Wsc mywsc = new Wsc("Mike", "Mike@163.com");
Response.Write("我是" + mybv.Name + ",现在是银行的客户,请联系我,Email:" + mybv.Email);
Response.Write("<br>");
Response.Write("我是" + mywsc.Name + ",现在是网站的客户,请联系我,Email:" + mywsc.Email);
}
}
}
我是用VS2005 ,以前用VS2003会自动有namespace的,但是2005就没了
为什么它会报错,我感觉代码没问题,报错内容是:
编译器错误信息: ASPNET: 请确保此代码文件中定义的类与“inherits”属性匹配,并且该类扩展的基类(例如 Page 或 UserControl)是正确的。请问怎么改