473,406 Members | 2,345 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,406 software developers and data experts.

Displaying Progress info to client while ServerSide code executes.

Hello, I just wanted to suggest this as an idea and get feedback if it
is a lame. I had a simple challenge. In my app a client can upload a
file and it took a while and I wanted to indicate to the client that
something was happening. Not a true indicaition of status but just a
..gif letting the client know that "Something" was happening and also
remove the Submit button they just clicked so they wouldn't keep
clicking etc.

I saw several involved articles about multithreading etc. and this
seemed more than needed for my problem. My idea, which seems to work
is to create a custom validator with the ControlToValidate = "". This
causes the javascript function you place in the
ClientValidationFunction to always fire. This is where I hide the
panel(div) that shows the submit button and all other data entry
fields and then show another panel with an animated .gif showing
flying files etc.

The custom validator looks like this. You have to support a ServerSide
version too but just have both client and server pass back "true"
because you aren't really using them to validate but rather just to
fire a javascript method prior to posting.

As I said it works but can anyone see why this isn't a good idea to
do? Thanks in advance Chris.

//Custom Validator
<asp:customvalidator id="validAddItemBtn" ControlToValidate=""
Display="Dynamic" ErrorMessage="" OnServerValidate="ValidAddItem_SVR"
ClientValidationFunction="validAddItem"Runat="serv er"></asp:customvalidator>

//javascript
function validAddItem(source,args)
{
//hide data entry panel
document.all.BodyPanel.style.display = 'none';

//display 'wait' panel
document.all.WaitPanel.style.display = '';

//return true for validation
args.IsValid = true;

}
Nov 17 '05 #1
2 1695
Well if it works then I can't complain too much.
I don't see the need for a validation control though. It seems to me you
could simplify by just calling your javascript function directly from your
onclick event, or your page's onsubmit event.
Here's more info:
http://www.devguru.com/Technologies/..._onsubmit.html

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
Hire top-notch developers at http://www.able-consulting.com


"Chris Tillotson" <ct********@aimworld.com> wrote in message
news:4f**************************@posting.google.c om...
Hello, I just wanted to suggest this as an idea and get feedback if it
is a lame. I had a simple challenge. In my app a client can upload a
file and it took a while and I wanted to indicate to the client that
something was happening. Not a true indicaition of status but just a
.gif letting the client know that "Something" was happening and also
remove the Submit button they just clicked so they wouldn't keep
clicking etc.

I saw several involved articles about multithreading etc. and this
seemed more than needed for my problem. My idea, which seems to work
is to create a custom validator with the ControlToValidate = "". This
causes the javascript function you place in the
ClientValidationFunction to always fire. This is where I hide the
panel(div) that shows the submit button and all other data entry
fields and then show another panel with an animated .gif showing
flying files etc.

The custom validator looks like this. You have to support a ServerSide
version too but just have both client and server pass back "true"
because you aren't really using them to validate but rather just to
fire a javascript method prior to posting.

As I said it works but can anyone see why this isn't a good idea to
do? Thanks in advance Chris.

//Custom Validator
<asp:customvalidator id="validAddItemBtn" ControlToValidate=""
Display="Dynamic" ErrorMessage="" OnServerValidate="ValidAddItem_SVR"
ClientValidationFunction="validAddItem"Runat="serv er"></asp:customvalidator>
//javascript
function validAddItem(source,args)
{
//hide data entry panel
document.all.BodyPanel.style.display = 'none';

//display 'wait' panel
document.all.WaitPanel.style.display = '';

//return true for validation
args.IsValid = true;

}

Nov 17 '05 #2
Good ideas. I tried puttting javascript code in the onclick event of my
<asp:imagebutton> control but kept getting an error. I suspect this was
due to the fact that their was a server side handler attached to the
onclick already. I guess I don't know how to have a single
<asp:imagebutton> object fire both a client and serverside call. The
onSubmit of the form may work. I will have to see how it interacts with
other validation controls that are present.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 17 '05 #3

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

Similar topics

8
by: Aspersion | last post by:
I'm building an ASP page that has a lot of text and graphics. There is a calculation facility on the page. The user enters several numbers in a form and presses a button to see the calculated...
13
by: Martin Mrazek | last post by:
Hi, I check data validity in html form by JS. Something like for (i=0; i<document.form.elements.length; i++) { chechkValidity(i); } Unfortunately, the form has about two thousands elements...
3
by: Brian Birtle | last post by:
**** A CHALLENGE TO THE GURUS - refute the statement "It's impossible to build a file upload progress meter using ASP.NET" **** First person to prove me wrong gets "All Time .NET Programming GOD"...
7
by: moondaddy | last post by:
I want to dynamically create a JavaScript file and cache it on the client for re-use. I know how to write javascript to a web page from the code behind, but I don't know how to actually create a...
3
by: Daniel | last post by:
Hi, Is there good article recommend for how to build a progress bar, or any idea? Thank.
6
by: viki | last post by:
Hi, I want to run the batch file from the client side. I was able to do it in the server side by using process. But i want to run from the client side , like we do in asp using...
6
by: Ernie | last post by:
I have a unique issue... We are using Microsoft Commerce Server and Content Manager on our eCommerce Site. I have been requested to display a login status (Pic that says Please Wait) in a control...
1
by: Anonieko | last post by:
Query: How to display progress bar for long running page Answer: Yet another solution. REFERENCE: http://www.eggheadcafe.com/articles/20050108.asp My only regret is that when click the...
2
by: Bob | last post by:
I know how to use php/mysql, but the html aspect of what Im trying to do (if its even possible this way) is what Im unsure of. I want to have a button that a user can hit to valid mysql info...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.