This is a migrated thread and some comments may be shown as answers.

Firefox ResponseScripts and Alert

1 Answer 28 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Marco
Top achievements
Rank 1
Marco asked on 10 Nov 2011, 05:34 PM
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.

1 Answer, 1 is accepted

Sort by
0
Marco
Top achievements
Rank 1
answered on 10 Nov 2011, 05:50 PM
Nevermind, somewhere in my javascript I had a bug (bad syntax). I corrected it and now everything works as expected.

Thanks.
Tags
Ajax
Asked by
Marco
Top achievements
Rank 1
Answers by
Marco
Top achievements
Rank 1
Share this question
or