Were are the ascx files used in custom visual webparts in the 15 hive?

They used to be in the controltemplates\%project% folder.

3 Answers 3


If you are talking about creating custom visual webparts, the ascx file will not be in the 15 hive as it was in SP2010, the ascx is generated by the webpart's dll when the code is executed, it's not going to be available in the 15 hive.

  • I opened the wsp and sure enough it seems like they are indeed MIA. I hate this! I would do a quick xcopy deployment while working out UI issues. Now I have to waste hours a week with build then deploys. Automated or not this takes way longer than copying one few k file. Aug 23, 2013 at 19:07
  • @JoeJohnston Have you reached to any workaround this issue as it is really wasting a lot of time? Nov 11, 2013 at 12:45
  • The physical files do not exist. I think they are assimilated into metadata. Nov 12, 2013 at 13:30
  • 1
    CKS Copy To GAC will save you weeks of deploys :P
    – James Love
    May 27, 2016 at 11:37

The *.ascx is converted to code using the custom tool "SharePointWebPartCodeGenerator". This tool generates the MyWebPart.ascx.g.cs (for C#; I guess in VB it will be *.ascx.g.vb) that contains several BuildControl-methods. The BuildControl-methods will be executed by the BuildControlTree that also contains additional Content (e.g. like JavaScript or "normal" HTML output).

Therefore, the ascx file itself is not necessary and will not be deployed.That is the reason we never find System.Web.UI.UserControl added on MyWebPart.ascx.g.cs file which is autogenerated by Visual Studio. If you want short development cycles, you can use tools like CKSDev that allow a quick deployment of the compiled assembly to the GAC (without deploying the whole solution). This is not as fast as editing and copying the ascx-file, but it is faster than waiting for the whole solution to be deployed by SharePoint.


They are in C:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\TEMPLATE\CONTROLTEMPLATES

  • 1
    I cleared up my question to specify ascx files from custom visual web parts. Aug 23, 2013 at 19:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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