我已经创建了一个名为MyMasterPage的母版页。ASP.NET - 你如何引用一个不在app_code中的类
public partial class MyMasterPage : System.Web.UI.MasterPage
{
protected void Page_Load(object sender, EventArgs e)
{
}
}
我也创建了一个名为Class 1类中的app_code:
public class Class1
{
public Class1()
{
MyMasterPage m;
}
}
在Class我想引用MyMasterPage但我得到一个编译器警告:
The type or namespace name 'MyMasterPage' could not be found (are you missing a using directive or an assembly reference?)
做些什么码我需要添加才能使这个工作?
类在文件夹如下:
alt text http://www.yart.com.au/stackoverflow/masterclass.png
到底在哪你的母版类关系到你的App_Code文件? – 2009-04-16 01:32:17
您的代码可以访问App_Code文件夹中的Class1吗? – TechTravelThink 2009-04-16 01:39:33