Solved

SharePoint 2010 User Controls

Posted on 2010-11-22
1
1,209 Views
Last Modified: 2012-06-27
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
Comment
Question by:obautista
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 3

Accepted Solution

by:
Nomoho earned 500 total points
ID: 34202005
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

Enroll in May's Course of the Month

May’s Course of the Month is now available! Experts Exchange’s Premium Members and Team Accounts have access to a complimentary course each month as part of their membership—an extra way to increase training and boost professional development.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I used to be SharePoint evangelist in our company, so my Outlook always full of questions about how to do this, or where I can find that. One day I found such an email with the following question: "how to attach 3-State workflow (one of the workflow…
Summary In SharePoint 2010 it is easy to create custom color themes to jazz up a site. Theme colors can also be created in PowerPoint 2010 with a few clicks. But how do the chosen colors actually look in the SharePoint site? The attached PowerPoint…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question