Ven
Ven

Reputation: 13

sys.application and sys.webforms is undefined

I have a master page ,A page(aspx) and A control(ascx)

error messages

I am getting three errors on the page.

1. Sys.Application is undefined
at this line (function() {var fn = function() {$get...);})();Sys.Application.initialize(); 
2. Sys.Application is undefined
[Break On This Error] (function() {var fn = function() {$get...};Sys.Application.add_load(fn);})(); 
3.Sys.WebForms is undefined
[Break On This Error] var prm = Sys.WebForms.PageRequestManager.getInstance(); 

I have pasted the code relavent to the the error message.

Code in the Control --------

jQuery.noConflict();
    jQuery(document).ready(function () {
        BlockUI("<%=pnlAddEdit.ClientID %>");
        jQuery.blockUI.defaults.css = {};
    });
    function BlockUI(elementID) {
        var prm = Sys.WebForms.PageRequestManager.getInstance(); //error at this line
        prm.add_beginRequest(function () {
            jQuery("#" + elementID).block({ message: '<table  align = "center" border=1><tr><td>' +
     '<img src="images/loadingAnim.gif"/></td></tr></table>',
                css: {},
                overlayCSS: { backgroundColor: '#f1f1f1', opacity: 12.2
                }
            });
        });
        prm.add_endRequest(function () {
            jQuery("#" + elementID).unblock();
        });
    }

Code in the master page ------------

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>

Code in Aspx page -----------

<%@ Register     Assembly="AjaxControlToolkit"     Namespace="AjaxControlToolkit"     TagPrefix="asp" %> 

How can I resolve this. I have no Idea. please help.

Upvotes: 1

Views: 6773

Answers (1)

Aristos
Aristos

Reputation: 66641

This error is come because you do not have include the asp:ScriptManager on your page, or you call this function before this ScriptManager load their script.

So if you have inlcude the asp:ScriptManager on your page, the second think that you can do is to call them after the page have been loaded (on PageLoad).

The better place to add your script manager call is on the master page.

Upvotes: 2

Related Questions