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

I just run this example: http://msdn.microsoft.com/en-us/library/ms470880.aspx

But I dont see what are delegate controls for, I can do this same thing with webparts or visual webparts, so what are the benefits?

share|improve this question
add comment

2 Answers

up vote 4 down vote accepted

Well delegate controls provide you with Content Lightup functionality. So what it means to a developer is he can have the same control to exhibit different based on the scope of the feature.

Delegate controls act as a container for any other custom functionality (e.g. user control). On runtime a delegate control will be replaced by a control that uses its ID at a specific scope (as you might have seen in the msdn article).

After you register your delegate control on your master page you can control which functionality your delegate control renders at what scope or you can choose to leave it unused and it won't be rendered on the page at all.

Hope this helps..

share|improve this answer
add comment

To enhance Viveks answer.

Delegate controls are defined in the master page as place holders for controls. SharePoint uses this extensively. For instance it uses a delegate control to insert the My Site menu, user profile redirection, menus, search boxes etc. The delegate control place holder can define if it allows one or more delegate controls. If configured so that it only can contain one control, you as a developer can create your own delegate ctrl and replace the current one. That is you can replace very much of the OOB functionality.

As Vivek says, the delegate controls can be differently scoped so that one site or site collection might have one delegate ctrls and another one a completley different on at the same place. To get an idea on what delegate controls are available I previously have written a blog post about it: http://www.wictorwilen.se/Post/Useful-Delegate-Controls-in-Windows-SharePoint-Services-30.aspx

share|improve this answer
add comment

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.