Login | Register   
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


advertisement
 

SharePoint's Delegate Control Power : Page 3

Learn about a handy feature that lets you isolate the functionality of one control from another on one or more Web sites.


advertisement
Extra, Extra HTML
What about situations where you need to wrap the delegate control in some static HTML? Although it's possible to include HTML around the DelegateControl, that approach emits the HTML whether the DelegateControl exists or not. Two attributes—PrefixHtml and SuffixHtml—control the HTML to be emitted before the delegate control and the HTML to be emitted after the delegate control, respectively. This technique allows you to add HTML only when a delegate control exists. You’ll find that the out-of-the-box SharePoint templates do this when they want to emit a <div> tag with a class around content when it appears.

The Scope attribute is another delegate control attribute. While it may appear to be seemingly useless, it does allow you to filter delegate controls to those deployed by features of the same scope. This attribute allows you to make certain delegate controls work throughout the entire farm, not just within a single web site or web application. Farm features are activated automatically when they are installed, allowing the template designer to create points that must be applied everywhere.

The out-of-the-box default.master defines these delegate controls for you to override:

  • AdditionalPageHead
  • GlobalSiteLink0
  • GlobalSiteLink1
  • GlobalSiteLink2
  • SmallSearchInputBox
  • TopNavigationDataSource
  • PublishingConsole
  • QuickLaunchDataSource
Of these, only the AdditionalPageHead is set to allow multiple controls. Notice that PublishingConsole is defined, which is true even if MOSS isn't installed.



Delegate controls are an important option for creating solutions that can be mixed and matched with other options. The ability to isolate one feature on a site from another feature can be an important tool in the SharePoint developer's toolbox.



Robert Bogue, MCSE (NT4/W2K), MCSA:Security, A+, Network+, Server+, I-Net+, IT Project+, E-Biz+, CDIA+ has contributed to more than 100 book projects and numerous other publishing projects. He was recently honored to become a Microsoft MVP for Microsoft Commerce Server and before that Microsoft Windows Servers-Networking. Robert blogs at http://www.thorprojects.com/blog.
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap