Firefox ResponseScripts and Alert

2 posts, 0 answers
  1. Marco
    Marco avatar
    20 posts
    Member since:
    Feb 2009

    Posted 10 Nov 2011 Link to this post

    Hello,

    I have a page with a grid and some labels. On grid item command event (grid is ajax enabled with RadAjaxManager) I want to do some code and then return an alert with the results. The following code works (shows the alert) in IE, Chrome and Opera, but not in Firefox.

    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"
        DefaultLoadingPanelID="RadAjaxLoadingPanel1"
        onajaxrequest="RadAjaxManager1_AjaxRequest">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="MyGrid" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="MyGrid">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="MyGrid" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="MyButton">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="Label1" />
                    <telerik:AjaxUpdatedControl ControlID="Label2" />
                    <telerik:AjaxUpdatedControl ControlID="Label3" />
                    <telerik:AjaxUpdatedControl ControlID="Label4" />
                    <telerik:AjaxUpdatedControl ControlID="Label5" />
                    <telerik:AjaxUpdatedControl ControlID="Label6" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>

    protected void MyGrid_ItemCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e)
    {
        if(e.CommandName == "MyCommand")
        {
            ScriptManager.RegisterStartupScript(Page, typeof(Page), "alert", "alert('StartupScript');", true); 
            RadAjaxManager1.ResponseScripts.Add("alert('ResponseScripts');");
        }
    }

    Any ideas?

    Thanks in advance.
  2. Marco
    Marco avatar
    20 posts
    Member since:
    Feb 2009

    Posted 10 Nov 2011 Link to this post

    Nevermind, somewhere in my javascript I had a bug (bad syntax). I corrected it and now everything works as expected.

    Thanks.
Back to Top