1-888-365-2779
+1-888-365-2779
Try Now
More in this section

Forums / General Discussions / Sitefinity : Admin can't access JavaScript folder from Master Pages

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

2 posts, 0 answered
  1. Preetham Reddy
    Preetham Reddy avatar
    57 posts
    Registered:
    16 Jul 2012
    28 Dec 2010
    Link to this post
    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?
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    28 Dec 2010
    Link to this post
    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
2 posts, 0 answered