|
-
Feb 13th, 2008, 08:05 AM
#1
Thread Starter
New Member
[2005] Show whilst processing request
I have been writting ASP.Net sites for a couple of years for fun but have decided to have my first attempt at writing a desktop. The program is very simple and just hooks up to an existing web service to check for new posts etc.
Been surprised how easy it was to create to be honest. The one problem that I have is that whilst logging in the app takes a wee while. What is the easiest way to feedback to the user that the log in is happening and not that the program has hung (as it currently looks)?
Many thanks
-
Feb 13th, 2008, 08:09 AM
#2
Re: [2005] Show whilst processing request
Welcome to the forums. 
What is a "wee while", and what is going on (code wise) during this time?
-
Feb 13th, 2008, 08:40 AM
#3
Thread Starter
New Member
Re: [2005] Show whilst processing request
Wee while = a short but noticable length of time - on my slow connection at home it is probably 5 seconds.
Codewise at the moment, nothing else is going on during this time. The event is triggered by click the login in button, after validation of fields being completed the webservice is then called and awaits the response. If login is successful it then continues, if it fails then the appropriate error message is shown.
I'm afraid I dont know anywhere near enough about desktop apps to do anything more clever
-
Feb 13th, 2008, 11:20 AM
#4
Re: [2005] Show whilst processing request
The very simplest solution would be to put up an hourglass cursor. Of course, that cursor would just sit there, so it doesn't really show the user much of anything, except that perhaps the program is doing something...or perhaps it has gone away and won't come back. You've probably seen plenty of both, so you probably have a feel for the value of that suggestion. It ain't great.
A better solution would be to have a more dynamic response, such as a progress bar that keeps moving, or something like that, but in this case, that will be tricky to do. If the delay was caused by lots of small steps, you could just update some image or progress bar after each step, but your delay is caused by one big step rather than lots of little ones. To get the same result, what you'd have to do is split the call to the webservice off into a background thread. This would be a reasonably straightforward thing to do, but multithreading can be quite a subject. The reason for doing it would be that the background thread would go and get the response while the main UI thread would just steadily update the image to show that something is happening. Of course, if the background thread never returned, the UI would just keep painting away forever, so you'd probably want a timer on the UI thread to periodically check the status of the background thread. What you'd be looking for in that check is a bit hard to say, but at the very least you could keep a count of how long the background thread has been operating, and if it appears to have been going for an unseemly length of time, you could mention that to the user, and ask them if they wanted to keep waiting, or wanted to kill off the background thread.
My usual boring signature: Nothing
 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|