Rank: Member Groups: Member
Joined: 10/9/2007 Posts: 18
|
Hi, I am trying to bind data using an SitemapDatasource and Sitemap Provider. I want to remove menu items conditionally from the control. When I try to do this in itemDatabound function, I am getting an error "Object reference not set to an instance of an object. "
The Remove statement was like this:
If (e.NavigationItem.Level = 0) Then mnuSlide.Items.Remove(e.NavigationItem) End if Kindly, Let me know how to remove menu items.
Regards, Viren
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,217
|
Hi Viren,
You can't do that while you are data binding. Try set the item's Visible to false instead.
Thanks
|