betul Posted March 17, 2008 Share Posted March 17, 2008 Hi,I created a datalist in a master page and used this page in Default.aspx, when I open the browser it gives this error;Object reference not set to an instance of an object.The error belongs to; conn.Open(); adapter.Fill(d, "Categories"); menuList.DataSource = new DataView(d.Tables[0]); //this line menuList.DataBind(); When I remove masterpage and bind the datalist in Default.aspx.cs with the same code, it works perfect. However I don't want to bind it in each page again and again.. What might be the problem?Thanks. Link to comment Share on other sites More sharing options...
aspnetguy Posted March 18, 2008 Share Posted March 18, 2008 Please post the code for your master page and default page (including code behind). Link to comment Share on other sites More sharing options...
betul Posted March 22, 2008 Author Share Posted March 22, 2008 Thank you, I removed all the files and rewrote the code, finally it works. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.