SPC150208: Reference 15 hive in strings within code

References in strings in the code to hive folder '/_controltemplates', '/_layouts' and '/_layouts/images/' must be changed accordingly to point to the 15 hive (e.g. by changing to '/_controltemplates/15/').

TypeName: ReplaceReferencesToOlderHivesInCode
CheckId: SPC150208
Severity: Warning
Type: AssemblyFileReference
Resolution

Change all strings in code which contains '/_controltemplates', '/_layouts' or '/_layouts/images/' to a correct path to 15 hive: '/_controltemplates/15/', '/_layouts/15/' or '/_layouts/15/images/'. See sample below:

protected override void CreateChildControls()
{
   var smallUserControl = this.Page.LoadControl("~/_CONTROLTEMPLATES/15/Company/smallUserControl.ascx");
   this.Controls.Add(smallUserControl);
}

comments powered by Disqus