473,499 Members | 1,653 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Ajax - How disable screen until function is done

I have an ajax enabled asp.net webform.

I coded a button that does a bunch of stuff. It could take up to 30 seconds
to process.

How can I disable everything on the screen immediately when the person
clicks the button and enable everything after the processing is completed?

Thanks!
Aug 16 '08 #1
2 3268
I hope this will help people in the future. This is how I did this...

I put all the controls in a panel, Panel1.

I added this javascript to the page....
<script type="text/javascript">
//add event handlers to the search UpdatePanel
Sys.WebForms.PageRequestManager.getInstance().add_ beginRequest(startRequest);
Sys.WebForms.PageRequestManager.getInstance().add_ endRequest(endRequest);

function startRequest(sender, e) {
//disable controls during the AJAX call
document.getElementById("<%=Panel1.ClientID%>").di sabled = true;
}

function endRequest(sender, e) {
//re-enable controls once the AJAX call has completed
document.getElementById("<%=Panel1.ClientID%>").di sabled =
false;
}
</script>
I hope this helps someone!

Take care!
Aug 17 '08 #2
Use a modalPopup to advise the user for the working in progress

(i hope this is usefull) :)

Fabio

"Cirene" <ci****@nowhere.comha scritto nel messaggio
news:ey**************@TK2MSFTNGP02.phx.gbl...
>I have an ajax enabled asp.net webform.

I coded a button that does a bunch of stuff. It could take up to 30
seconds to process.

How can I disable everything on the screen immediately when the person
clicks the button and enable everything after the processing is completed?

Thanks!
Aug 17 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
2730
by: 1kHz | last post by:
Hi all.. I'm new with this Ajax thingy and have done some experimenting. I did some codes according to examples from http://www.webpasties.com/xmlHttpRequest/ and...
31
3070
by: Tony | last post by:
I just noticed that prototype.js is one of the files in the Ajax.NET distribution - I'm pretty concerned about this. Does anyone know if this is the same "prototype.js" that is not well-liked...
17
3117
by: Steve-O | last post by:
The following code works great in FireFox, Opera, Netscape, Safari, and Gecko, but NOT IE. Why? I tried using 'native' js with setInterval and setTimeout, but I get the same result. My IE...
6
5120
by: =?Utf-8?B?U2hhd24gU2VzbmE=?= | last post by:
Greetings! I was researching AJAX to provide a solution to displaying status messages while a long process executed. I found several examples online and was able to use their code to get a quick...
1
1812
by: violinandviola | last post by:
I have just put 4 different ajax bits on this page: http://jimpix.co.uk/default-ajax.asp The ajax spits out chunks of images / news content, and users can view the chunks via next / prev links....
22
1664
by: sheldonlg | last post by:
I am looking for a clean solution to a problem that I solved in, what I call, a "dirty" way. Here is what I want to do. I have a dropdown list. Clicking on an item in the dropdown list invokes...
4
5343
by: Peter | last post by:
ASP.NET I have an application which use ASP.NET Autocomplete extender which works great. But I have a question how to update all the fields on the screen using Ajax. Users starts typing in a...
0
1547
Frinavale
by: Frinavale | last post by:
I have a peculiar problem... Background: I have a function that I don't want the user to execute more than once while they are waiting for it to process; therefore, I disable all of the...
29
24353
by: FreshRob | last post by:
I have been trying to fix this issue the whole of today and have gotten no where. I am developing a new website, and wanted it to display a webpage in lightbox and have an external page added to the...
0
7131
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7007
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
6894
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7388
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
4919
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4600
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3091
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1427
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
297
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.