Reputation: 1
included the jquery-1.3.2.min.js and and blockUI-2.15.0.js here
<script type="text/javascript">
$(document).ready(function() {
$(".noButton").click(function(e) {
e.preventDefault();
$.blockUI({ message: $('#AreYouSureMessage') });
});
$('.noButtonPopup').click(function() {
doNoPostBack();
return true;
});
$('.yesButtonPopup').click(function() {
doYesPostBack();
return true;
});
$.blockUI.defaults.overlayCSS.opacity = 0.7;
$.blockUI.defaults.css.width = '500px';
$.blockUI.defaults.css.border = '1px solid #000000';
$.blockUI.defaults.css.height = '700px';
$.blockUI.defaults.fadeOut = 0;
Note: I am getting the error like below in IE
'$.blockUI.defaults' is null or not an object
Upvotes: 0
Views: 3006
Reputation: 1
My solution for this issue is put all the jquery reference files together in the same folder. and also check the path of all the jquery files is correct or not (../Script/jquery.BlockUI.js).
notice on ../
Also check for the same reference to jQuery.js was included in the content page once again.
Ref Link for
http://amitchandnz.wordpress.com/2010/08/24/jquery-blockui-using-animated-image/
To add BlockUI for Masterpage so that the entire site can perform loading panel when postback
######################################################################################
<%@ Master Language="C#" AutoEventWireup="true" CodeFile="Site.master.cs" Inherits="SiteMaster" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head runat="server">
<title></title>
<script type="text/javascript" src="../Scripts/jquery/jquery-1.9.1.js"></script>
<script type="text/javascript" src="../Scripts/jquery/jquery-ui.js"></script>
<link rel="stylesheet" type="text/css" href="Scripts/jquery/jquery-ui.css" />
<script src="../Scripts/jquery/jquery.blockUI.js" type="text/javascript"></script>
<script type="text/javascript">
function BlockUI(elementID) {
var prm = Sys.WebForms.PageRequestManager.getInstance();
prm.add_beginRequest(function () {
$("#" + elementID).block({ message: '<table><tr><td>' + '<img src="../Scripts/jquery/ajax-loader.gif"/></td></tr></table>',
css: {},
overlayCSS: { backgroundColor: '#FFFFFF', opacity: 0.6, border: '1px solid #000000' }
});
});
prm.add_endRequest(function () {
$("#" + elementID).unblock();
});
}
$(document).ready(function () {
BlockUI("divMain");
$.blockUI.defaults.css = {};
});
</script>
<asp:ContentPlaceHolder ID="HeadContent" runat="server">
</asp:ContentPlaceHolder>
</head>
<body>
<form runat="server">
<asp:UpdatePanel ID="ajaxUpdatePanel" runat="server">
<ContentTemplate>
<div id="divMain">
<asp:ContentPlaceHolder ID="MainContent" runat="server"/>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</form>
</body>
</html>
######################################################################################
**Download link for jquery.BlockUI.js**
http://jquery.malsup.com/block/#download
**Download link for jquery core**
http://jquery.com/download/
**URL for alternatre loading Icon**
http://www.ajaxload.info/
Hope this may help.
Upvotes: 0
Reputation: 2598
We just faced the same issue in one of our content pages (Web Form). Other content pages tied with the same master page were working well.
Actually we had included the jQuery.js file reference in master page, but the same reference to jQuery.js was included in the content page once again. That was causing the error message "$.blockUI.defaults' is null or not an object".
This also means, even if you have referenced the jQuery.js file incorrectly in any .aspx page, you may face the similar error message.
Hope this may help.
Upvotes: 2