RegisterClientScript on AJAX request

4 posts, 0 answers
  1. QualiWareUA
    QualiWareUA avatar
    54 posts
    Member since:
    Sep 2008

    Posted 26 Apr 2008 Link to this post

    Hello,

    I have some Rad controls on my form. Interacting with them does not perform form post back, but AJAX request. Nevertheless I may use RegisterClientScript to do some JavaScript after post back. But as post back is not performed, JavaScript is never executed. How can I overcome this?
  2. Todd Anglin
    Todd Anglin avatar
    2040 posts
    Member since:
    Aug 2005

    Posted 26 Apr 2008 Link to this post

    Vlad-

    I assume you're using the Telerik RadAjaxManager to ajaxify your page. Is that correct? If so, you'll find it has a convenient "ReponseScripts" collection that allows you to add JavaScript that should be fired after the Ajax operation completes. The JavaScript can be added on the server during the Ajax callback and then it will be automatically executed by the RadAjaxManager when the callback is done.

    Check out the docs for more details:

    http://www.telerik.com/help/radcontrols/prometheus/?ajxCustomJavaScript.html

    Hope that helps-
    Todd
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. QualiWareUA
    QualiWareUA avatar
    54 posts
    Member since:
    Sep 2008

    Posted 27 Apr 2008 Link to this post

    Hi Todd,

    I do not use RadAjaxManager. But anyway thank you. I have already figured out how to accomplish this task. Instead of

    page.ClientScript.RegisterStartupScript

    it necessary to use static method

    ScriptManager.RegisterStartupScript.
  5. Todd Anglin
    Todd Anglin avatar
    2040 posts
    Member since:
    Aug 2005

    Posted 28 Apr 2008 Link to this post

    Great. I'm glad you found the solution to your problem. And if you're looking for an easier way to add ASP.NET AJAX to your pages (without all of the messy markup and trigger definitions), definitely check out the RadAjaxManager, too.

    -Todd
Back to Top