這是我所有的類的共同結構:ASP.NET ObjectDataSource控件問題
public class User
{
public int ID { get;set; }
public string User_name { get; set; }
public string Pass_word { get; set; }
public string UserTypeCode { get; set; }
public int SaveOrUpdate()
{
int id = -1;
if (this._ID <=0)
{
id = this.Save();
}
else
{
bool success = this.Update();
if(success)
{
id = this._ID;
}
else
{
throw new Exception("Update failed!");
}
}
return id;
}
private int Save() { }
private bool Update() { }
public static User Get(int id) { }
public static List<User> Get() { }
public bool Delete() { }
}
我使用這些類平穩,WinForms的。
但是,當使用ASP.NET時,當我嘗試爲GridView配置對象數據源時,我在Data Source Configuration Wizard
中找不到方法名稱。即他們沒有出現。所以我的方法變得毫無用處。
我不能改變我所有類的這個一般結構。我還爲他們編寫了一個代碼生成器。我必須使用ObjectDataSources
。
我的第一個問題是,他們爲什麼不出現?
而且,我應該怎麼做才能讓它們顯示出來?
你能從aspx頁面和/或code-behind發佈代碼嗎? 這可能會更有助於發現錯誤。 – 2009-11-17 18:19:31
哦,沒關係,我猜你說你甚至不能配置標籤。 – 2009-11-17 18:30:42