User1310055179 posted
Hi,
I have a dynamic web form and in some cases the postback is taking a long time (e.g when connecting to a remote database).
The postback triggers a javascript function that enables a rendering gif and a div that blocks the user from editing the form.
I would like to run this JS function only if the postback takes more than 1 second to run.
This is my code:
JS functions:
function skm_LockScreen(str)
{
var lock = document.getElementById(str);
if (lock)
lock.className = 'LockOn';
}
function skm_unLockScreen(str)
{
var lock = document.getElementById(str);
if (lock)
lock.className = 'LockOff';
}
function pageLoad()
{
skm_unLockScreen('skm_LockPane');
}
ASPX:
<div id="skm_LockPane" class="LockOff" runat="server">
<asp:Image ID="render_img" runat="server" ImageUrl ="~/Images/progress.gif" style=" z-index:7000; position:absolute; top:30%; left:45%;
height:60px; width: 60px; " />
</div>
Codebehind:
sTextBox.Attributes.Add("onchange", "skm_LockScreen('skm_LockPane');");
What is the best way to achieve it?