1
我創建了VS2008網站,在App_Code文件夾中,我增加一類無法訪問方法在類中App_Code文件爲VS2008
namespace irfulabs
{
[DataObject(true)]
public static class fooDALC
{
[DataObjectMethod(DataObjectMethodType.Select, true)]
public static IList<Screen> Getfoo()
{
//Do something
}
[DataObjectMethod(DataObjectMethodType.Insert, true)]
public static void Insert(Screen src)
{
//Do something
}
[DataObjectMethod(DataObjectMethodType.Update, true)]
public static void Update(Screen src)
{
//Do something
}
[DataObjectMethod(DataObjectMethodType.Delete, true)]
public static void Delete(Screen src)
{
//Do something
}
}
}
在頁面加載事件中,我調用的方法
using irfulabs;
GridView1.DataSource = fooDALC.Getfoo();
GridView1.DataBind();
並且我收到錯誤消息「CS0103:名稱'fooDALC'在當前上下文中不存在'