When you save a webpart (.ascx) in Visual Studio 2012 it should generate an .ascx.g.cs file. You can force the generation by right-clicking the .ascx file and ‘Run custom tool’, given that the ‘Custom Tool’ property of the .ascx file is set to ‘SharePointWebPartCodeGenerator’. 148 more words