How to included an embedded js file
I am asking about how to embed a js file in a custom widget, I am following the steps below however I got the error attached in "Error.png":
1- Set the "BuildAction" of the js file is set to "EmbeddedResource" (please review "JsBuildAction,png")
2- Add the registration of the js file in the AssemblyInfo.cs of the web application
3- add a link to the js file from my custom widget
Am I missing something?
Can you try to make the registration as bellow:
I am trying to use the ResourceLinks control to embed a JS file a CSS file along with including the built-in JQuery. I think I have all the steps correct, but no go. Looks like an issue with Sitefinity maybe. Here is what I did:
1) Set the build action to embedded for the js and css files
2) Add this to AssemblyInfo.cs:
[assembly: WebResource("SitefinityWebApp.Widgets.Ads.Resources.Stylesheets.internAds.css", "text/css")]
3) Added the correct resource links format to the template files:
<sf:ResourceLinks ID="resourcesLinks" runat="server">
AssemblyInfo="SitefinityWebApp.Widgets.Ads.InternAd, SitefinityWebApp" />
SitefinityWebApp" /> </sf:ResourceLinks>
Note that I am including the widget right in the SitefinityWebApp project instead of using a compiled widget.
Your help will be really appreciated.
Can you try setting the UseEmbeddedThemes property on ResourceLinks control to true? Also for the CSS file, please set the Static property to true.
All the best,
the Telerik team