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

Jquery

5 posts, 0 answered
  1. Dino
    Dino avatar
    21 posts
    Registered:
    13 Jan 2008
    22 Jan 2009
    Link to this post
    Hi
    There is a way to add jquery in Generic Content and use javascprit from there?

    I mean after I put the reference in masterpage can I refer to jquery inside generic content in administation side only in the page that  I want?

    thanks
  2. SelAromDotNet
    SelAromDotNet avatar
    912 posts
    Registered:
    18 Jul 2012
    22 Jan 2009
    Link to this post
    do you mean that you want to add jquery reference to the site master page, but only use it in the admin mode? adding jquery to the masterpage will make it accessable globally throughout all pages, whether you are in admin mode or not.

    if you want to restrict jquery you could use the script manager by adding the jquery at run time based on the page status:

    protected void Page_Load(object sender, EventArgs e) {
        if (IsPageInAdmin())
            RadScriptManager1.Scripts.Add(new ScriptReference("/path/to/jquery.js"));
    }
     
    private bool IsPageInAdmin() { // will return TRUE is the page is viewed in administration part 
        if (Page.Request.RawUrl.IndexOf("cmspagemode=preview") > 0) return true; // will return TRUE is the page is in editing mode 
        if (Page.Request.RawUrl.IndexOf("cmspagemode=edit") > 0) return true; // the page is viewed in the public part. 
        return false;
    }

    I hope this was helpful!

    by the way where is the code paster for this forum?
  3. Dino
    Dino avatar
    21 posts
    Registered:
    13 Jan 2008
    22 Jan 2009
    Link to this post
    Sorry but maybe my explanation it was no good..
    I mean add javascript in Generic Content when edit html in the page from admininitration site.
    Is it possible ?
  4. SelAromDotNet
    SelAromDotNet avatar
    912 posts
    Registered:
    18 Jul 2012
    22 Jan 2009
    Link to this post
    oh okay I think you are asking how to embed javascript inline into generic content is that right?

    i think by default the generic content control filters out any scripts... take a look at this thread: http://www.sitefinity.com/support/forums/support-forum-thread/b1043S-bcmtek.aspx

    I believe this might point you in the right direction. I hope this was helpful!
  5. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    26 Jan 2009
    Link to this post
    Hi,

    Actually, the AllowScripts attribute is obsolete in the latest versions of the RadEditor. That is why you should
    remove AllowScripts="true" and place ContentFilters="None" in the RadEditor tag:

    <telerik:RadEditor 

    Other than that, the templates are described in the forum thread provided in the Josh's post.

    Kind regards,
    Georgi
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Register for webinar
5 posts, 0 answered