Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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
add comment

1 Answer

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
add comment

Your Answer

 
discard

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.