I am trying to get a datalist to work, so I can use it as a menu. This is a learning experience for me, and would like to figure it out. I sort of used the TimeTracker as an example. Anyway, I build the ArrayList as the DataList datasource, but it doesn't work. So I put in a DataGrid, and copied the setting and binding of the datasource, and it works. I'll copy the page_load code to show how I'm doing this. I'm not including the TabItem class, but it appears to be working, cause it works for the DataGrid. Can anyone explain what is going wrong. When I try to used the DataList, I get the following error in the browser:
Object reference not set to an instance of an object.
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
And the following line is highlighted red:
Line 58: tabs.DataSource = menuItems;
public abstract class Banner : System.Web.UI.UserControl
protected System.Web.UI.WebControls.DataList tabs;
protected System.Web.UI.WebControls.DataList MenuList;
//protected System.Web.UI.WebControls.DataGrid DataGrid1;
protected System.Web.UI.WebControls.Image Image1;
private void Page_Load(object sender, System.EventArgs e)
View Complete Post