Sitefinity : Admin can't access JavaScript folder from M

Posted by Community Admin on 03-Aug-2018 09:25

Sitefinity : Admin can't access JavaScript folder from Master Pages

All Replies

Posted by Community Admin on 28-Dec-2010 00:00

Hi,

I have a page that uses Master Page in the App_Master folder. When I access this page anonymously, it's working well. However, if I try to access the same page after logging-in as an Admin, the jQuery in the master page isn't executing. As a result, all the images in the page are screwed up.

What am I doing wrong? The javascript folder is in the application root.

When anonymous user can access it, why can't admin (who has more power) access it?

Posted by Community Admin on 28-Dec-2010 00:00

Hello Preetham,

Please try the following which should work fine no matter of the user you use

1. In your master page register Telerik.Sitefinity.Web.UI.PublicControls

<%@ Register TagPrefix="sf" Assembly="Telerik.Sitefinity" Namespace="Telerik.Sitefinity.Web.UI.PublicControls"%>


2. Add reference to your custom script. Note: add the sctript inside a folder of your theme.

<sf:JavaScriptEmbedControl runat="server" ID="test111" ScriptEmbedPosition="BeforeBodyEndTag" Url="Sitefinity/WebsiteTemplates/PageTemplates/App_Themes/Test/js/script.js" ></sf:JavaScriptEmbedControl>


3. Simple js function

function test()
    alert("jQuery alert");
;


4. Call the function from the custom script

<script type="text/javascript">
    $(document).ready(function ()
        
            test();
        
    );
</script>



All the best,
Ivan Dimitrov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

This thread is closed