RadAjaxManager and RegisterStartupScript

4 posts, 0 answers
  1. ithihas
    ithihas avatar
    14 posts
    Member since:
    Jun 2012

    Posted 12 Jul 2012 Link to this post

    Hi All,

    I have a Probelm.

    On my ASPX Site I have an 
                            Skin="Office2007" /> 
                        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">  
                                <telerik:AjaxSetting AjaxControlID="FormView1">  
                                            LoadingPanelID="RadAjaxLoadingPanel1" /> 

    In the code behind I register some javascripts by setting RegisterStartupScript

                protected void FormView1_ItemCommand(object sender, FormViewCommandEventArgs e)  
                    switch (e.CommandName)  
                        case "Cancel":  
                            //ClientScript.RegisterStartupScript(Page.GetType(), "mykey", "CancelEdit();", true);  
                            Page.ClientScript.RegisterStartupScript(this.GetType(), "alertScript""alert('test');"true);  
                        case "Update":  
                            ClientScript.RegisterStartupScript(Page.GetType(), "mykey""CloseAndRebind();"true);  
                        case "Insert":  
                            ClientScript.RegisterStartupScript(Page.GetType(), "mykey""CloseAndRebind('navigateToInserted');"true);  

    But this script only fired if I remove the radajaxmanager.
    What's wrong here?

    And second. Is there a good example on how I use the ajaxmanger in combination with master and contentpages.

    Thanks for help.
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 13 Jul 2012 Link to this post


    When programming in  MS AJAX environment the scripts should be register with ScriptManager instead of page's ClientScriptManager. Check the following help documentation and demo which explains using ajax with master pages and content pages.


  3. pedrotti
    pedrotti avatar
    41 posts
    Member since:
    Apr 2011

    Posted 25 Sep 2013 Link to this post

    Hi Shinu,

    Could give me a simple but complete exemple
    In the demo, I do not see where you use ScriptManager. RegisterStartupScript.
    I tried several tests, but he has to miss me some parameters because that does not work.

    Thank you for your help

  4. Maria Ilieva
    Maria Ilieva avatar
    4017 posts

    Posted 27 Sep 2013 Link to this post


    Revise the help topic below for more information on registering client scripts with Ajax:

    Maria Ilieva
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Back to Top