Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET > Editor > insterting javascript
RadControls for ASP.NET are no longer supported (see this page for reference). In case you have inquiries about the Telerik ASP.NET AJAX controls, post them in the pertinent ASP.NET AJAX forums.

insterting javascript

Feed from this thread
  • matthew avatar

    Posted on Oct 16, 2007 (permalink)

    I am trying to insert below code into the html editor of a page to have a page counter on this page. http://teachers.greenville.k12.sc.us/sites/kewells/default.aspx


    <!-- Start Bravenet.com Service Code -->
    <script language="JavaScript" type="text/javascript" src="http://pub24.bravenet.com/counter/code.php?id=390663&amp;usernum=1995023170&amp;cpv=2">
    </script>
    <!-- END DO NOT MODIFY -->


    I update the page and view it and nothing appears.

    I check back to the html view and only the
    <!-- Start Bravenet.com Service Code --><!-- END DO NOT MODIFY -->
     is there.  all other code is erased.  What am I doing wrong.  I have conferred with the supplier of the code and they insist that there is nothing wrong with the code and that it is the editor I am using. any ideas? Thanks



    T

  • Rumen Rumen admin's avatar

    Posted on Oct 17, 2007 (permalink)

    Hi matthew,

    You should set the editor's AllowScripts property to true and the editor will not strip the inserted JavaScript code:

    <radE:RadEditor id="RadEditor1" AllowScripts="true" Runat="server">

    <!-- Start Bravenet.com Service Code -->
    <script language="JavaScript" type="text/javascript" src="http://pub24.bravenet.com/counter/code.php?id=390663&amp;usernum=1995023170&amp;cpv=2">
    </script>
    <!-- END DO NOT MODIFY -->


    </radE:RadEditor>

    This should do the trick.

    Best regards,
    Rumen
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center

  • matthew avatar

    Posted on Oct 17, 2007 (permalink)

    I am not sure how to change the editor ssettings.  I see no place to change the settings when it opens.  Do I insert the tag below into the html and than procede with the javascript I want to insert?

    <radE:RadEditor id="RadEditor1" AllowScripts="true" Runat="server">

  • Rumen Rumen admin's avatar

    Posted on Oct 17, 2007 (permalink)

    Hi Matt,,

    The AllowScripts property is part of the RadEditor server-side API. This means that you can set this property inline in the RadEditor declaration:

    <rade:radeditor
       
    id="RadEditor1"
       
    runat="server"
      
    AllowScripts="true">
    </
    rade:radeditor>

    or using the CodeBehind:

    private void Button1_Click(object sender, System.EventArgs e)
    {
     
      RadEditor1.AllowScripts = true;
    }

    or using the ~/RadControls/Editor/ConfigFile.xml file:

    <property name="AllowScripts">true</property>

    Please, review the following help article, which provide guidance how to set the editor's properties: Setting Properties.

    Best regards,
    Rumen
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center

  • matthew avatar

    Posted on Oct 17, 2007 (permalink)

    I am guessing that this is not something I can do unless I have access to the setup of the program.  I am just using the editor because that is what was supplied by the school district I am making the web page for.  Do I need to contact someone in the web department and inquire about a change or am I still missing that this is something I can do directly on the editor?

  • Rumen Rumen admin's avatar

    Posted on Oct 17, 2007 (permalink)


    Yes, you should contact the responsible developer in your web department and ask it to set this property. Thus RadEditor will not strip the SCRIPT tags in the content area.

    Best regards,
    Rumen
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center

  • matthew avatar

    Posted on Oct 19, 2007 (permalink)

    My webmaster says the change has been made but I still can not get my java hit counter (or other java codes) to come up on the page.  the code still will not stay in the editor.  ANy other suggestions?

  • Rumen Rumen admin's avatar

    Posted on Oct 22, 2007 (permalink)

    Hi Matthew,

    If RadEditor still strips the SCRIPTS tags in its content area, then this means that the AllowScripts property is not set to true. If you are using an old RadEditor's version such as 3.x / 4.x then you need to set the AllowServerScripts to true.

    Please, see the attached video demonstrating how the AllowScripts property works.

    You can also provide a live url to the site with the editor that you are using so that we can test the editor.

    Best regards,
    Rumen
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
    Attached files

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET > Editor > insterting javascript