This is a migrated thread and some comments may be shown as answers.

Scripts embeded in WebControls not running

1 Answer 85 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Roy Gelerman
Top achievements
Rank 1
Roy Gelerman asked on 17 Mar 2008, 08:18 PM

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?


1 Answer, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 18 Mar 2008, 06:41 AM
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
Tags
Ajax
Asked by
Roy Gelerman
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Share this question
or