Embedding UserControls to HTML page created by Design Manager

Posted Yorum yapınSharepoint 2013 içinde yayınlandı

The design crash after you embed 2 or more User Controls in a html file.I have been figuring out a way to solve that problem today.

You can register User Controls using this statement:

[sourcecode language=”csharp”]
<!–SPM:<%@Register TagPrefix="UC" TagName="SampleUC" src="~/_controltemplates/SampleIntranet/SampleUC.ascx"%>–>

Normally you can use;

[sourcecode language=”csharp”]
<!–MS:{UserControl registration}–>

but when you add 2 user controls same way,design crashes.So you need to close the MS statement using “ME”.

Here’s how you can do it:

[sourcecode language=”csharp”]
<!–MS:<UC:SampleUC runat="server" id="SampleUCID">–>;
<!–MS:<UC:SampleUC2 runat="server" id="SampleUCID2">–>

Hope that fix helps you

Problem & Solution: This solution contains no resources scoped for a Web application…

Posted Yorum yapınSharepoint 2013 içinde yayınlandı

When i tried to deploy a webpart to a webapplication using both PS and Central Administration,i got the following warning:

This solution contains no resources scoped for a Web application and cannot be deployed to a particular Web application.

It tried to deploy it to GAC which i didnt want.Because it needs to be deployed to a WebApplication in my farm

Solution is;
Started Visual Studio and the project,opened Package.Template.xml in an editor and edited the line in yellow:

DeploymentTarget property needs to be set as “WebApplication”.Even though i changed it via project properties,it kept changing to GACDeployment so i had to edit Package xml.Just to be sure.

After deployment i got to choose the webapplication where i want it deployed.

Hope it helps