Whilst developing an app for wss3/moss I had some trouble and I thought I’d share it.

One of the great things about new sharepoint is Delegate controls.  If in your masterpage or other page you have a SharepointDelegateControl in there you can plonk your own replacement version in there.  There are essentially placeholders for you to use for branding.

Now when I develop for wss I separate everything into various folders and name them appropriately usually in a namespace Style.

e.g.

My Feature could be called   BinaryJam.MyApplication

and of course wherever else can use a folder name to separate it out from the rest I also do that.  I got stumped for ages when I had created  a delegate control and tried to register it and it just didn’t appear.

So here is my example elements that failed

<Elements xmlns="http://schemas.microsoft.com/sharepoint/"
  <Control
    Id="AdditionalPageHead"
    Sequence="100"
    ControlSrc="~/_controltemplates/BinaryJam.MyApplication/CustomLinksControl.ascx">
  </Control>
  </Elements>

Hmmmm, however if you remove the "namespace" element of the folder name then it works

<Elements xmlns="http://schemas.microsoft.com/sharepoint/"
  <Control
    Id="AdditionalPageHead"
    Sequence="100"
    ControlSrc="~/_controltemplates/BinaryJamMyApplication/CustomLinksControl.ascx">
  </Control>
  </Elements>

Just that one full stop can make it stop working so if something doesn’t work check your paths for full stops cos there’s some dodgy regexes going on in good old wss3.

For more about delegate controls here is a handy guide.

 

Technorati Tags: ,,
Advertisements