Question

I am using Telerik controls in Dotnetnuke custom modules, A problem has happened to all ajax controls and the result is A postback request every time instead of Ajax Request.

In Firebug i can see,

Sys.InvalidOperationException: Sys.InvalidOperationException: The PageRequestManager cannot be initialized more than once.

the exception source is Telerik.Web.UI.WebResource.axd,

I know it's not Telerik itself but a conflict between Telerik and DOTNETNUKE AJAX, however i couldn't know where.

Any ideas to catch this exception and handle it?

Was it helpful?

Solution

The problem was using telerik:RadScriptManager

I've used the following code to get the Excel import for RadGrid working,

        <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
    </telerik:RadScriptManager>
    <script type="text/javascript">
        Sys.WebForms.PageRequestManager.getInstance().add_initializeRequest(initRequest);
        function initRequest(sender, args) {
            if (args.get_postBackElement().id.indexOf("ExportTo") != -1) {
                args.set_cancel(true);  //stop async request
                sender._form["__EVENTTARGET"].value = args.get_postBackElement().id.replace(/\_/g, "$");
                sender._form["__EVENTARGUMENT"].value = "";
                sender._form.submit();
                return;
            }
        }

The solution is to delete the extra RadScriptManager, since Dotnetnuke already has one.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top