Add this in the Webpage.
<asp:scriptmanager id="ScriptManger1" runat="server" enablepartialrendering="true" xmlns:asp="#unknown">
<Scripts>
<asp:scriptreference path="js/Progress.js" />
</Scripts>
</asp:scriptmanager>
Css for Gray out will be like this :-
.loadingPopup
{
border: 2px;
padding: 4px;
border-color: Black;
position: fixed;
top: 50%;
left: 50%;
visibility: hidden;
}
And Finally Add this Code in the Progress.Js File and add to the solution.
Sys.WebForms.PageRequestManager.getInstance().add_beginRequest(BeginRequestHandler);
Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);
function BeginRequestHandler(sender, args) {
showProgress();
}
function EndRequestHandler(sender, args) {
hideProgress();
}
function showProgress() {
grayOut(true, "");
var spinner = $get("AjaxLoading");
if (spinner == null) return;
spinner.style.visibility = "visible";
}
function hideProgress() {
grayOut(false, "");
var spinner = $get("AjaxLoading");
if (spinner == null) return;
spinner.style.visibility = "hidden";
}
function grayOut(vis, options) {
var optionsoptionsoptions = options || {};
var zindex = options.zindex || 50;
var opacity = options.opacity || 30;
var opaque = (opacity / 100);
var bgcolor = options.bgcolor || '#000000';
var dark = document.getElementById('darkenScreenObject');
if (!dark) {
tbody = document.getElementsByTagName("body")[0];
var tnode = document.createElement('div');
tnode.style.position = 'fixed';
tnode.style.top = '0px';
tnode.style.left = '0px';
tnode.style.overflow = 'hidden';
tnode.style.display = 'none';
tnode.id = 'darkenScreenObject';
tbody.appendChild(tnode);
dark = document.getElementById('darkenScreenObject');
}
if (vis) {
var pageWidth = '100%';
var pageHeight = '100%';
dark.style.opacity = opaque;
dark.style.MozOpacity = opaque;
dark.style.filter = 'alpha(opacity=' + opacity + ')';
dark.style.zIndex = zindex;
dark.style.backgroundColor = bgcolor;
dark.style.width = pageWidth;
dark.style.height = pageHeight;
dark.style.display = 'block';
}
else {
dark.style.display = 'none';
}
}
if (typeof (Sys) !== 'undefined') Sys.Application.notifyScriptLoaded();
In This Way i had done gray out the page .