Saturday, March 7, 2015

The name ‘InitializeControl’ does not exist in this context. SharePoint 2013 Visual Web Part development

While developing Visual Web Parts for SharePoint 2013 using Visual Studio 2012, suddenly you may get an error. “The name ‘InitializeControl’ does not exist in this context”.


To fix this error quickly, select user control file (.ascx) of visual web part in Visual Studio and check if its property Custom Tool = SharePointWebPartCodeGenerator.


Also make sure that Site URL property of your project is set properly.

Then, right click on user control (.ascx) of visual web part and click on “Run Custom Tool”. It will fix all issues with .ascx.g.cs file and you will be good to go.


No comments:

Post a Comment