473,394 Members | 1,724 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Need Mechanism or code for wait state in asp.net web application

SP
Hi,
I want to add wait cursor code whenever page is post back. Page may be
post back on my user control's or on change of dropdown or on click of any
button on page. so is there any common solution available that will provide
me mechanism to display wait cursor or wait image to user whenever page is
post back to server?

Thanks,
--
Nov 18 '05 #1
6 2419
put a script on body on event onbeforeunload="ChangeCursorStatus();"

javascript:
function ChangeCursorStatus(){
document.body.style.cursor = "wait";
}

it's very unpleasant this solution because you have to put in every page,
but it works. I couldn't find any other solution to put this code dinamically
on body :(.

Cheers

"SP" wrote:
Hi,
I want to add wait cursor code whenever page is post back. Page may be
post back on my user control's or on change of dropdown or on click of any
button on page. so is there any common solution available that will provide
me mechanism to display wait cursor or wait image to user whenever page is
post back to server?

Thanks,
--

Nov 18 '05 #2
SP
Thanks Psycho,

I tried that solution but it will solve my half problem, actually i want
to display user a cursor and also put application in wait state that user
can not perform another action till one action is performed. means if user
click on my save button then till save action is performed and page is load
till that user can not perform any other action means he will restrict till
one action performed.

I have one solution of threading. means put application in thread and wait
that thread for some second and till that display some image after
completing this i show form to user. but it will give error when i redirect
page to another page that data can not send because of http header is
already written.

If you will know any other solution than please tell me.

Thanks once again,


"Psycho" <Ps****@discussions.microsoft.com> wrote in message
news:18**********************************@microsof t.com...
put a script on body on event onbeforeunload="ChangeCursorStatus();"

javascript:
function ChangeCursorStatus(){
document.body.style.cursor = "wait";
}

it's very unpleasant this solution because you have to put in every page,
but it works. I couldn't find any other solution to put this code dinamically on body :(.

Cheers

"SP" wrote:
Hi,
I want to add wait cursor code whenever page is post back. Page may be post back on my user control's or on change of dropdown or on click of any button on page. so is there any common solution available that will provide me mechanism to display wait cursor or wait image to user whenever page is post back to server?

Thanks,
--

Nov 18 '05 #3
you should try to make all of your controls disabled. i use a javascript also
for this task. So on event onbeforeunload put another javascript to disable
controls or make a function which is doing your both tasks.

some function like this
function DisableControls(){
nr = document.forms[0].all.length;
for(i=0;i<nr;i++){
if(document.forms[0].all(i).tagName == "SELECT" ||
(document.forms[0].all(i).tagName == "INPUT" &&
(document.forms[0].all(i).type == "radio" || document.forms[0].all(i).type ==
"checkbox" || document.forms[0].all(i).type == "button") ))
document.forms[0].all(i).disabled = true;
}
}

Cheers

"SP" wrote:
Thanks Psycho,

I tried that solution but it will solve my half problem, actually i want
to display user a cursor and also put application in wait state that user
can not perform another action till one action is performed. means if user
click on my save button then till save action is performed and page is load
till that user can not perform any other action means he will restrict till
one action performed.

I have one solution of threading. means put application in thread and wait
that thread for some second and till that display some image after
completing this i show form to user. but it will give error when i redirect
page to another page that data can not send because of http header is
already written.

If you will know any other solution than please tell me.

Thanks once again,


"Psycho" <Ps****@discussions.microsoft.com> wrote in message
news:18**********************************@microsof t.com...
put a script on body on event onbeforeunload="ChangeCursorStatus();"

javascript:
function ChangeCursorStatus(){
document.body.style.cursor = "wait";
}

it's very unpleasant this solution because you have to put in every page,
but it works. I couldn't find any other solution to put this code

dinamically
on body :(.

Cheers

"SP" wrote:
Hi,
I want to add wait cursor code whenever page is post back. Page may be post back on my user control's or on change of dropdown or on click of any button on page. so is there any common solution available that will provide me mechanism to display wait cursor or wait image to user whenever page is post back to server?

Thanks,
--


Nov 18 '05 #4
Hi SP:

You don't want to go anywhere near the threading classes for this one,
trust me. You need to perform actions on the client, and the least
intrusive way to do this is with client side script.

Psycho: If you create a base class to derive all your web forms from,
you can put a call to RegisterClientScript in one place and have the
script appear in all of your web forms. There are a few articles
around describing how inherit from the Page class to add useful
features. Here is one:

http://msdn.microsoft.com/library/de...rockASPNET.asp

HTH,

--
Scott
http://www.OdeToCode.com/blogs/scott/

On Wed, 27 Oct 2004 17:41:15 +0530, "SP" <SP@Microsoft.com> wrote:
Thanks Psycho,

I tried that solution but it will solve my half problem, actually i want
to display user a cursor and also put application in wait state that user
can not perform another action till one action is performed. means if user
click on my save button then till save action is performed and page is load
till that user can not perform any other action means he will restrict till
one action performed.

I have one solution of threading. means put application in thread and wait
that thread for some second and till that display some image after
completing this i show form to user. but it will give error when i redirect
page to another page that data can not send because of http header is
already written.

If you will know any other solution than please tell me.

Thanks once again,


"Psycho" <Ps****@discussions.microsoft.com> wrote in message
news:18**********************************@microso ft.com...
put a script on body on event onbeforeunload="ChangeCursorStatus();"

javascript:
function ChangeCursorStatus(){
document.body.style.cursor = "wait";
}

it's very unpleasant this solution because you have to put in every page,
but it works. I couldn't find any other solution to put this code

dinamically
on body :(.

Cheers

"SP" wrote:
> Hi,
> I want to add wait cursor code whenever page is post back. Page maybe > post back on my user control's or on change of dropdown or on click ofany > button on page. so is there any common solution available that willprovide > me mechanism to display wait cursor or wait image to user whenever pageis > post back to server?
>
> Thanks,
>
>
> --
>
>
>


Nov 18 '05 #5
Thanks for advice Scott but i'm already using a customPage and also the
method RegisterStartupScript. My problem is with body. I can't attach any
event dinamically. I don't want to go to every page to put on body
runat="server" and id="body" just to add from behinde code, javascript on
body events. So I prefer to add on body events. Is any other way to do this?
"Scott Allen" wrote:
Hi SP:

You don't want to go anywhere near the threading classes for this one,
trust me. You need to perform actions on the client, and the least
intrusive way to do this is with client side script.

Psycho: If you create a base class to derive all your web forms from,
you can put a call to RegisterClientScript in one place and have the
script appear in all of your web forms. There are a few articles
around describing how inherit from the Page class to add useful
features. Here is one:

http://msdn.microsoft.com/library/de...rockASPNET.asp

HTH,

--
Scott
http://www.OdeToCode.com/blogs/scott/

On Wed, 27 Oct 2004 17:41:15 +0530, "SP" <SP@Microsoft.com> wrote:
Thanks Psycho,

I tried that solution but it will solve my half problem, actually i want
to display user a cursor and also put application in wait state that user
can not perform another action till one action is performed. means if user
click on my save button then till save action is performed and page is load
till that user can not perform any other action means he will restrict till
one action performed.

I have one solution of threading. means put application in thread and wait
that thread for some second and till that display some image after
completing this i show form to user. but it will give error when i redirect
page to another page that data can not send because of http header is
already written.

If you will know any other solution than please tell me.

Thanks once again,


"Psycho" <Ps****@discussions.microsoft.com> wrote in message
news:18**********************************@microso ft.com...
put a script on body on event onbeforeunload="ChangeCursorStatus();"

javascript:
function ChangeCursorStatus(){
document.body.style.cursor = "wait";
}

it's very unpleasant this solution because you have to put in every page,
but it works. I couldn't find any other solution to put this code

dinamically
on body :(.

Cheers

"SP" wrote:

> Hi,
> I want to add wait cursor code whenever page is post back. Page may

be
> post back on my user control's or on change of dropdown or on click of

any
> button on page. so is there any common solution available that will

provide
> me mechanism to display wait cursor or wait image to user whenever page

is
> post back to server?
>
> Thanks,
>
>
> --
>
>
>


Nov 18 '05 #6
Ah, apologies - I didn't really think about the body tag needing to be
runat=server (and honestly, JavaScript is a real weak area for me).
--
Scott
http://www.OdeToCode.com/blogs/scott/

On Wed, 27 Oct 2004 07:59:10 -0700, Psycho
<Ps****@discussions.microsoft.com> wrote:
Thanks for advice Scott but i'm already using a customPage and also the
method RegisterStartupScript. My problem is with body. I can't attach any
event dinamically. I don't want to go to every page to put on body
runat="server" and id="body" just to add from behinde code, javascript on
body events. So I prefer to add on body events. Is any other way to do this?


Nov 18 '05 #7

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

Similar topics

4
by: Andy Gayton | last post by:
Hey all, It looks like dynamic changes to a html document are only redrawn when the current code snippet comes to an end. For example the following page changes the text in a span, waits for a...
0
by: inetmug | last post by:
Hello: I am using ASP.NET as our front end. I also have to interface to some legacy systems that use a callback mechanism. The legacy systems use callbacks (via CORBA) to communicate back to...
1
by: John | last post by:
Hi First of all apologies for posting so much code but this is rather involved and I am totally stumped. Basically I have a main form (Staff Batch SMS/E-Mail) which calls a function (SendSMS) in...
106
by: xtra | last post by:
Hi Folk I have about 1000 procedures in my project. Many, many of them are along the lines of function myfuntion () as boolean on error goto er '- Dim Dbs as dao.database Dim Rst as...
4
by: Sharon | last post by:
I wish to control other threads, that are warped with my own classes, so when they are in any wait state (lock(), Monitor.Wait(), ReadWriteLock.Wait(), Mutex.Wait(), AutoResetEvent.Wait(),...
0
by: Paramveer.Singh | last post by:
Hi! I was looking into the postgres error handling mechanism, and the documentation states that the present mechanism is primitive. I quote "whenever the parser, planner/optimizer or executor...
12
by: Noel | last post by:
Hello, I'm currently developing a web service that retrieves data from an employee table. I would like to send and retrieve a custom employee class to/from the webservice. I have currently coded...
4
by: PJ6 | last post by:
This is the only solution I've found to get a wait cursor document-wide: function Busy() { if (document.all) for (var i=0;i < document.all.length; i++) document.all(i).style.cursor = 'wait'; }...
14
by: shawnk | last post by:
I searched the net to see if other developers have been looking for a writable iterator in C#. I found much discussion and thus this post. Currently (C# 2) you can not pass ref and out arguments...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...

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.