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
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.