RadAjaxManager and RegisterStartupScript

4 posts, 1 answers
  1. Christian
    Christian avatar
    112 posts
    Member since:
    May 2010

    Posted 13 May 2009 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. Answer
    Rosen avatar
    3253 posts

    Posted 15 May 2009 Link to this post

    Hello Uwe,

    As you may know when programming in  MS AJAX environment the scripts should be register with ScriptManager instead of page's ClientScriptManager. For more information please refer to this msdn article under Registering Partial-Page Update Compatible Scripts section.

    As to your other question please refer to this online demo for a demonstration of master page scenario.

    All the best,
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. Christian
    Christian avatar
    112 posts
    Member since:
    May 2010

    Posted 16 May 2009 Link to this post

    Hi Rosen,

    thanls a lot. This hint solved my problem. :)

  4. Simone
    Simone avatar
    34 posts
    Member since:
    Mar 2011

    Posted 13 Feb 2012 Link to this post

    Solved mine too.

    Changed from:
    Page.ClientScript.RegisterStartupScript(this.GetType(), "ProgramUpdated", "SetArgumentValue(" + "'ProgramUpdated'" + ");", true);
    ScriptManager.RegisterStartupScript(this, this.GetType(), "ProgramUpdated", "SetArgumentValue(" + "'ProgramUpdated'" + ");", true);
Back to Top