Login Progress Bar

E

Ernie

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 that is located on multiple pages.
Therefore I need to embed a code segment to be executed when a specific
button is pressed to display the "Please Wait" without having to wait
for the postback to finish.

I am looking to do this in a client side script that is usable by most
browsers. Any assistance or direction would be greatly appreciated.

We are not allowed to use frames (and I agree). The code primarily used
is C#. The following is a code snippet of the button that I need to
capture and execute a client side script:

<asp:Button id="Button1" style="Z-INDEX: 101; LEFT: 40px; POSITION:
absolute; TOP: 128px" runat="server"
Text="Button"></asp:Button>

A Plan without Action is a DayDream
Action without a Plan is a Nightmare
 
D

Daniel M. Hendricks

Something like (you can replace the 'Please Wait' text with an image if
you like):

<%@ Page Language="C#" %>
<script runat="server">
private void Page_Load(object sender, System.EventArgs e)
{
btnSubmit.Attributes.Add("onclick",
"document.getElementById('msgWait').style.display='block'");
}
private void btnSubmit_Click(Object sender, EventArgs e)
{
// DO SOME TIME CONSUMING CODE HERE
}
</script>

<html><body>

<form runat="server">
<asp:Button id="btnSubmit" runat="server" Text="Submit"
onclick="btnSubmit_Click" /></p>
</form>

<div id="msgWait" style="display:none; color: red"><p>Please wait.
This may take up to a minute...</p></div>

</html></body>


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 that is located on multiple pages.
Therefore I need to embed a code segment to be executed when a specific
button is pressed to display the "Please Wait" without having to wait
for the postback to finish.
Daniel M. Hendricks
http://www.danhendricks.com
 
T

tomBond

Hi.

Check the net for code regarding Response.Buffering an
Response.Flush.

It can be done with these :)

-to


-
tomBon
 
E

Ernie

Thank you,

Initially I looked at using the Response.Buffer and Response.Flush along
with the Document.[Whatever] and these were unable to work in this
scenario. I may be missing something but this specific control is an
embedded HTML control on the Form. The code behind is executing the
validation within commerce server and therefore I am unable to pull it
out of the code behind to run as part of the C# script on the HTML code
segment.

I somehow need to identify that the button (which has an ID on the
ASPNET page) has been clicked (There is already a click event in the
codebehind).

In a nutshell, the login process can take a lot of time and I want to
display an image/text/animated gif to notify the user that the system is
processing and to please wait.

Thank you for your assistance


Walking on Water and Developing Applications from Specifications are
EASY ==> Only when they are FROZEN
 
G

Guest

I am also trying to do similar thing like you. I need something that will
tell user to wait, while waiting for query to return the result to display. I
looked at the code provided by Daniel, but my question how the progress page
will know to redirect to result page.

thanks in advance
 
G

Guest

I am also trying to do similar thing. I want progress page/bar while wating
for query to return the result to display. My question is how the progree
page/bar will know to redirect the page to the result page?

thanks in advance
 
T

tomBond

Progress page AND results page is the very same page. You can think thi
like the page having two different "modes": progress showing mode whe
page is doing something, and results showing mode when page ha
finished. The key in this approach is that all is in the same page
you don't do any redirecting (but you could if you need to :)
This is how it works: when request is sent to server, browser begin
waiting for servers response stream. Here buffering is needed, becaus
browser doesn't show the completed page unless the response has arrive
completely. Though the servers response is still in the middle o
transmission and has not completed yet, you can "steal" some amount o
the incoming stream, flush it to browser and thus have the "progres
showing mode" visible. At the same time server continues to send th
response as soon as it gets it ready. When the response has arrived t
browser completely, the page is complete and you can turn "progres
showing mode" (ie. graphics or text) off because it is not needed a
this point. The rest of the page now represents the "results showin
mode".

Remember that all server-side code gets processed first in asp.net,
thus giving you a chance to dynamically generate progress info for th
page. After server-side code processing comes client-side code, ie. an
html-code or client-side scripts.

One hint: if you se graphics with the progress mode, make sure tha
they are as small as possible in bytes so that they would be loade
really fast. What's the point of having heavy, slow loading graphics o
the progress showing mode if the processing gets finished before fanc
graphics reach the browser? ;)

-Tom


-
tomBon
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,011
Latest member
AjaUqq1950

Latest Threads

Top