• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1226
  • Last Modified:

SharePoint 2010 User Controls

I've created several user controls (.ascx files).  I then created a CUSTOM folder at this location:

C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\CONTROLTEMPLATES\

 I placed the User Controls in the CUSTOM folder.  I am trying to reference the controls from my Master Page like this:

<%@ Register TagPrefix="uc" TagName="HeaderControl" src="/_controltemplates/CUSTOM/Header.ascx" %>

I am using SharePoint Designer to modify the Master Page.  It says it cannot find the files referenced.  I have restarted the Site and restarted IIS.  Not sure why it isnt found.  

Thanks for any help provided....
0
obautista
Asked:
obautista
1 Solution
 
NomohoCommented:
Hello,

I have noticed you forgot the ~ symbol in your register:

<%@ Register TagPrefix="uc" TagName="HeaderControl" src="~/_controltemplates/CUSTOM/Header.ascx" %>

I have created several user controls registered in my master page by using this src url: "~/_controltemplates/CustomUserControl.ascx" (but without the folder)

Does it work if you move and register your ascx file in the control template folder?
Of course you must execute a IISRESET for the user control to be seen by sharepoint.
0

Featured Post

Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now