Updating SharePoint 2010 Web Parts For SharePoint 2013

Following an upgrade from SharePoint 2010 to 2013 I deployed some custom web parts.  When loading the page I received the error “/_CONTROLTEMPLATES/WEBPARTNAME/VisualWebPart1/VisualWebPart1UserControl.ascx” does not exist.

2013WebPartError1

The error is caused by the web part looking in the \14\TEMPLATE\CONTROLTEMPLATES folder rather than \15\TEMPLATE\CONTROLTEMPLATES.  Open the web part solution in Visual Studio and change the _ascxPath string.  Original value below:

2013WebPartError2

 

Change the string to include the 15 folder.

2013WebPartError3

 

Rebuild and re-deploy the web part.

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s