这是我所有的类的共同结构: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