编辑
这是我的新尝试:
现在我得到ObjectDataSource 'MenuDataSource' could not find a non-generic method 'GetData' that has no parameters.
<asp:ObjectDataSource
ID="GridDataSource"
SelectMethod="GetData"
TypeName="Model.GridProvider"
runat="server" >
<SelectParameters>
<asp:Parameter Name="MenuItemID" Type="Int32" DefaultValue="10" />
</SelectParameters>
</asp:ObjectDataSource>
public int DbToAccess
{
get
{
return SiteMaster.Current_MenuItemID;
}
}
[DataObject(true)]
public static class MyMenuProvider
{
[DataObjectMethod(DataObjectMethodType.Select)]
public static HierarchicalCollection GetData(int inputMenuItemID)
{
return GetCollection(inputMenuItemID);
}
}
我怎样才能做到这一点?