Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

Can someone please provide a definitive explanation of the roles and responsibilities of Navigation Providers, Datasource controls and Menu controls? You seem to be able to apply filtering and trimming in each of these so I'm wondering what the best practices are? I understand that the Menu controls are for the UI rendering but the Providers and DataSources are a bit more confusing.

Perhaps someone can provide a link to a definitive (and clearly written) article?

share|improve this question
    
Responsibilities of DataSource vs Provider - good question –  Jaap Vossers Nov 19 '09 at 22:10

1 Answer 1

up vote 3 down vote accepted

When you say Navigation Providers I assume you are referring to sitemapproviders. Basically sitemapproviders are code that determine the navigation. I have written quite a few of these to provide better navigation in SharePoint. SiteMapProviders will be asked by the Menu Control through the Datasource different things. The breadcrumb menu control will ask for the current node and then for each node that is returned it asks for the parent node until null is returned. The Top Nav menu control will ask for the root node, and then for each node that is returned, the menu control will ask for it's child nodes until the static or dynamic level is reached. I wrote a blog article about this a few years ago located here. I provide some sample code for writing a sitemapprovider. The code I provided has some issues with it and is not optimized but it can help you get started.

As far as datasources go, that's a typical thing in data bound webcontrols. You can assign the datasource of a control to be a sqldatasource, or a dataset, or in this case it's a sitemapdatasource. It basically converts the sitemapprovider data into something that the menu control can understand.

And yes the menu control just renders the UI. There is a special sharepoint menu control called aspmenu. The source for this control was distributed on the sharepoint blog a few years ago.

I hope all of this makes sense and answers your questions.

share|improve this answer
    
Thanks for your input Steve. It is interesting to know what the Providers do under the hood. I'll have a read of your article and code. Thanks again. –  j.strugnell Nov 20 '09 at 16:42

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.