URL to link JS files shows 404 error
hi,
I m new to sitefinity 4.2. i build a master template from my html template. i lnked css and js files as per structure. but these files are not loading to my template . getting 404 error
<link href="App_Data/Sitefinity/WebsiteTemplates/ePINS/App_Master/global/main.css" rel="stylesheet" media="screen" type="text/css" />
Hi Venkatesh,
If you need to use Jquery ( we have it included in Sitefinity ) for your masterpage you can use it just by adding the following code:
<%@ Register Assembly="Telerik.Sitefinity" Namespace="Telerik.Sitefinity.Web.UI" TagPrefix="sf" %>
// your logic here
<
sf:ResourceLinks id
=
"resourcesLinks"
runat
=
"server"
>
<
sf:ResourceFileJavaScriptLibrary
=
"JQuery"
/>
</
sf:ResourceLinks
>
<
sf:ResourceFileName
=
"JS/myfile.js"
/>
Thanks for ur reply.
When i add ur code in the body or head i m getting ResourceLink error.
i added like this
<%@ Register Assembly="Telerik.Sitefinity" Namespace="Telerik.Sitefinity.Web.UI" TagPrefix="sf" %>
<sf:ResourceLinks id="resourcesLinks" runat="server">
<sf:ResourceFileJavaScriptLibrary="JQuery"/>
<sf:ResourceFileName="JS/rollover.js"/>
</sf:ResourceLinks>
For time being i m using hand coded URL to get my javascript file. i m very new to this sitefinity 4.2. can u please help to solve this issue?
Thanks & Regards,
Venkatesh
Hello Venkatesh Alagu,
Please try the following:
1. Register the script inside AssemblyInfo.cs class of the class library
sample:
[assembly: WebResource("TestControlProject.Resources.RotatorDesigner.js", "application/x-javascript")]
2. The script file build action should be "EmbeddedResource"
Regards,
Victor Velev
the Telerik team
Hello Venkatesh Alagu,
Just a quick follow up.
Make sure to replace "TestControlProject.Resources.RotatorDesigner.js" with your path to the file.
Regards,
Victor Velev
the Telerik team