I searched on google for some clarifications but I didn't find the answers I've been looking for.
I want to deploy a delegate which would perform some custom functionality. That is why with a delegate I want to ship a classe with code, so I did a following:
I added a classe:
public class SomeClassForDelegate: WebControl
{
protected override void Render(System.Web.UI.HtmlTextWriter writer)
{
writer.WriteLine("<p>Write some text</p>");
base.Render(writer);
}
}
Basically this classe will write just a text. The reason why I do that is just to test if my classe is being used, normally I'll add totaly difirent functionality.
Then I have a delegate declaration in element.xml:
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<Control Id="AdditionalPageHead" ControlAssembly="$SharePoint.Project.AssemblyFullName$" ControlClass="mysolution.SomeClassForDelegate" Sequence="90" />
</Elements>
Which I deploy with a feature.
Everything goes good and well but at the end I don't see the result.
What am I doing wrong?
Update: Solved
The problem was that the webcontrol was not put as safe control. So in an element.xml I added whole folder as a safe place. And it was working.
Thank you for input, especially Dribbel!
<head>element of the page and thus will not render in the browser. And Did you specify aSequencevalue in your element file? – Dribbel Aug 3 '12 at 6:15