I have an ASP panel that contains a button. The button acts as the ajax initiator. When clicked, the button's server click event needs to run a javascript that is outside of the panel. I had to put the javascript outside of the panel because other controls outside of the panel also need to run the script. I decided to use a Literal control and simply put the javascript into the Text property in the button's click event. I am using RadAjaxManager. I thought I could then have the button act as an initiator for the literal control but that didn't work. Even putting the control inside of a PlaceHolder didn't work.
The script never gets executed. If I turn off Ajax, it does get executed.
When I read the documentation on RadAjax, it only says the following:
"RadScriptBlock is used where you have JavaScript that evaluates after an AJAX request, for example when the content of RadAjaxPanel is updated asynchronously. RadScriptBlock also can be used like RadCodeBlock to handle server code blocks (<% ... %>)."
What is not clear here is how this RadScriptBlock applies when you are NOT using a RadAjaxPanel. In any event, even after I add a RadScriptBlock, the script never runs.
The Microsoft documentation also indicates the following:
"If you want to register a script block that does not pertain to partial-page updates, and if you want to register the script block only one time during initial page rendering, use the RegisterClientScriptBlock method of the ClientScriptManager class."
The script I am trying to update is not what I consider a partial-page update. Either it should update always whenever any Ajax call is made or only when I want it to, such as in the button's click event. The confusion seems to be understanding when to use Microsoft's built-in Ajax functions and when to rely on Telerik's. Can someone please indicate how to solve my problem as I have spent hours with no success. Preferrably someone at Telerik should comment here on this issue because Telerik is clearly implementing a mixture of Microsoft's Ajax along with their own support mechanisms.
Thank you for your help
Johann
The script never gets executed. If I turn off Ajax, it does get executed.
When I read the documentation on RadAjax, it only says the following:
"RadScriptBlock is used where you have JavaScript that evaluates after an AJAX request, for example when the content of RadAjaxPanel is updated asynchronously. RadScriptBlock also can be used like RadCodeBlock to handle server code blocks (<% ... %>)."
What is not clear here is how this RadScriptBlock applies when you are NOT using a RadAjaxPanel. In any event, even after I add a RadScriptBlock, the script never runs.
The Microsoft documentation also indicates the following:
"If you want to register a script block that does not pertain to partial-page updates, and if you want to register the script block only one time during initial page rendering, use the RegisterClientScriptBlock method of the ClientScriptManager class."
The script I am trying to update is not what I consider a partial-page update. Either it should update always whenever any Ajax call is made or only when I want it to, such as in the button's click event. The confusion seems to be understanding when to use Microsoft's built-in Ajax functions and when to rely on Telerik's. Can someone please indicate how to solve my problem as I have spent hours with no success. Preferrably someone at Telerik should comment here on this issue because Telerik is clearly implementing a mixture of Microsoft's Ajax along with their own support mechanisms.
Thank you for your help
Johann