[Reminder] How-to add a custom usercontrol with the SharePoint Designer

Open the desired page (e.g. DispForm.aspx) with the SharePoint Designer and add the following code below the initial “<%@ statements”:

<%@ Register TagPrefix="MyNamePrefix" TagName="MyNameForTheControl"
Src="~/_controltemplates/MyCustomControls/MyCurrentlyUsedControl.ascx" %>

Now add this code where the control should appear in the final rendered page:

<MyNamePrefix:MyNameForTheControl ID="MyNameForTheControl" runat="server" />

Thats it!

Of course your user control must be placed in the TEMPLATE/CONTROLTEMPLATES folder (TEMPLATE/CONTROLTEMPLATES/MyCustomControls in this case) of your frontend server.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>