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

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

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

On January 13, 2008, Posted by , In SharePoint-Development,Verschiedenes, By ,,,, , With Comments Off on [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.

Comments are closed.