Scripts embeded in WebControls not running

2 posts, 0 answers
  1. Roy Gelerman
    Roy Gelerman avatar
    12 posts
    Member since:
    Jul 2006

    Posted 17 Mar 2008 Link to this post


    Hello,

    With the earlier RadAjax (non-prometheus) it was my experience that scripts embedded in a webcontrol would re-execute if the control was refreshed by RadAjax.

    for example if the control rendered on the client as so  :

    <span id="mywebcontrol" >
       <input type="text" id="mywebcontrol_text1"></input>
       <script language='javascript' type='text/javascript'>alert('test');</script>
    </span>

    a 'test' alert box would pop up when the page initially renders, and then whenever the control was later refreshed by the ajax manager.  This seems to be no longer happening for us.  Is there a workaround?


  2. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 18 Mar 2008 Link to this post

    Hello Roy,

    The "Prometheus" RadAjax is based on Microsoft ajax and the scripts registration here is a bit different. We have created RadScriptBlock to handle such cases. Here is an example:


    <span id="mywebcontrol" >
       <input type="text" id="mywebcontrol_text1"></input>
       <telerik:RadScriptBlock ID="
    RadScriptBlock1" runat="server">
           <script language='javascript' type='text/javascript'>alert('test');</script>
       </
    telerik:RadScriptBlock>
    </span

    All the best,
    Vlad
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top