SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

We were migrating the MOSS 2007 code to Sharepoint 2013 using Visual Studio 2012. We have usercontrols with code behind. When we add the mapped folder Control Templates in Visual Studio. It allows to add the code behind. But the property on this file is Deployment Type - nodeployment and this property is disabled. Is there a way to deploy the code behind files

share|improve this question

You can put your code behind file's dll into gac and then reference it in your User Control ".ascx" file. I am pretty sure it will work as I did it myself.

As far as I know be default this should work,

<%@ Control Language="C#" AutoEventWireup="true" CodeFile="CodeBehindExampleUserControl.ascx.cs" Inherits="CodeBehindExampleUserControl" %>

If above doesn't work, I recommend you to go through this article,

how to reference user control deployed

Hope it helps.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.