<
head
id
=
"Head1"
runat
=
"server"
>
<
title
></
title
>
<
style
type
=
"text/css"
>
.modal
{
position: fixed;
top: 0;
left: 0;
background-color: black;
z-index: 99;
opacity: 0.8;
filter: alpha(opacity=80);
-moz-opacity: 0.8;
min-height: 100%;
width: 100%;
}
.loading
{
font-family: Arial;
font-size: 10pt;
border: 5px solid #67CFF5;
width: 200px;
height: 100px;
display: none;
position: fixed;
background-color: White;
z-index: 999;
}
</
style
>
<
script
type
=
"text/javascript"
>
function ShowProgress() {
setTimeout(function () {
var modal = $('<
div
/>');
modal.addClass("modal");
$('body').append(modal);
var loading = $(".loading");
loading.show();
var top = Math.max($(window).height() / 2 - loading[0].offsetHeight / 2, 0);
var left = Math.max($(window).width() / 2 - loading[0].offsetWidth / 2, 0);
loading.css({ top: top, left: left });
}, 200);
}
</
script
>
</
head
>
<
body
>
<
form
id
=
"form1"
runat
=
"server"
>
Country:
<
asp:DropDownList
ID
=
"ddlCountries"
runat
=
"server"
>
<
asp:ListItem
Text
=
"All"
Value
=
""
/>
<
asp:ListItem
Text
=
"USA"
Value
=
"USA"
/>
<
asp:ListItem
Text
=
"Brazil"
Value
=
"Brazil"
/>
<
asp:ListItem
Text
=
"France"
Value
=
"France"
/>
<
asp:ListItem
Text
=
"Germany"
Value
=
"Germany"
/>
</
asp:DropDownList
>
<
asp:RequiredFieldValidator
ErrorMessage
=
"Required"
ControlToValidate
=
"ddlCountries"
runat
=
"server"
/>
<
asp:Button
ID
=
"btnSubmit"
runat
=
"server"
Text
=
"Load Customers"
OnClick
=
"btnSubmit_Click"
/>
<
hr
/>
<
asp:GridView
ID
=
"gvCustomers"
runat
=
"server"
AutoGenerateColumns
=
"false"
>
<
Columns
>
<
asp:BoundField
DataField
=
"CustomerId"
HeaderText
=
"Customer Id"
/>
<
asp:BoundField
DataField
=
"ContactName"
HeaderText
=
"Contact Name"
/>
<
asp:BoundField
DataField
=
"City"
HeaderText
=
"City"
/>
</
Columns
>
</
asp:GridView
>
<
div
class
=
"loading"
align
=
"center"
>
Loading. Please wait.<
br
/>
<
br
/>
<
img
src
=
"loader.gif"
alt
=
""
/>
</
div
>
</
form
>
<
script
type
=
"text/javascript"
>
function WebForm_OnSubmit() {
if (typeof (ValidatorOnSubmit) == "function" && ValidatorOnSubmit() == false) {
for (var i in Page_Validators) {
try {
} catch (e) { }
}
return false;
}
ShowProgress();
return true;
}
</
script
>
</
body
>
</
html
>