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

Telerik.Web.UI.WindowManager.Manager is undefined so RadConfirm is not working

1 Answer 237 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Rosalini
Top achievements
Rank 1
Rosalini asked on 17 Aug 2017, 07:52 AM

Hi Team, 

I have added RadConfirm() in the ASCX code behind on radbutton click page. But it's failing  in runtime throwing the runtime script error "JavaScript runtime error: Unable to get property 'radconfirm' of undefined or null reference".

window.radconfirm=function(h,a,g,d,b,f,c){var e=GetRadWindowManager();

return e.radconfirm(h,a,g,d,b,f,c);

};

here 'e' is undefined. 

My ascx code behind 

 else if (projectDropdown == ApplicationConstants.WF_CURRENCY_CONVERSION_CUBE_DISPLAY)
                        {
                            string Tag = string.Empty;
                            string confirmMsg = string.Empty;
                            List<string> factTag = presenter.GetFactTagAssociated(projectId, DsId);
                            if (factTag.Count > 0)
                            {
                                confirmMsg += "The listed facts will be impacted. <br/>";
                                foreach (string tag in factTag)
                                {
                                    Tag += tag + ",";
                                }
                                confirmMsg += Tag;
                             
                                confirmMsg += " <br/> Do you want to continue?";
                            }
                       
                           RadAjaxManager.GetCurrent(Page).ResponseScripts.Add("radconfirm('" + confirmMsg + "', callbackFunctionPerformStartProcessValidation , 300 ,100 , null ,'" + ApplicationConstants.CLOSE + "' )");

                            return;
                        }

 

ascx Script block

  function callbackFunctionPerformStartProcessValidation(arg) {
                if (arg) {
                    debugger;
                    var argument = "Start Process";
                    $find("<%= RadAjaxManager.GetCurrent(Page).ClientID %>").ajaxRequest(argument);
                }
            }

I have added telerik:RadWindowManager above the radscript block and below the script block too. but it's not working.

Please let me know how to progress. It's blocking me.

 

Thanks,

Rosalini

1 Answer, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 22 Aug 2017, 12:21 PM

Hello Rosalini,

My first suggestion is to use the server-side RadConfirm() method the RadWindowManager instance exposes: http://demos.telerik.com/aspnet-ajax/window/examples/browserdialogboxes/defaultcs.aspx.

If this is not suitable for you, make sure to use the Sys.Application.Load event to call the script: http://docs.telerik.com/devtools/aspnet-ajax/controls/window/troubleshooting/executing-javascript-code-from-server.

Also, as a general rule, I suggest that you avoid updating the RadWindowManager with AJAX, it operates primarily in the browser.

Regards,

Marin Bratanov
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
Ajax
Asked by
Rosalini
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Share this question
or