473,385 Members | 1,922 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,385 software developers and data experts.

How to show 'waiting...' mesage in page after submitting a web form

Scenario:

This is a reporting scenario where it takes a while to get
back a response ( report page ) after submit.

I want my user to see some kind of temporary message like
'Processing...' or 'Waiting.. ' after I clicked on a SUBMIT
button to post a web form.
Here is one solution. Anyone who has better?

Create an image button in the page small enough and add a click event
handler for this image button which will redirect to the target page.
The trick is to trigger the click on via javascript on the submit event
handler.

ASPX page has
-------------

...

<P align="center">
<asp:button id="btnSubmit" runat="server" Text="Show
Report"></asp:button>
<BR>
<asp:ImageButton id="triggerControl" runat="server" Width="1px"
Height="1px" ImageUrl="img/unknown.gif" />
<SPAN id="Processing" style="DISPLAY: none">
Please wait while creating report...
</SPAN>
</P>

<SCRIPT type="text/javascript">
var hasSubmitted = 0;
function NoDoubleSubmit() {
var divMsg = document.getElementById('Processing');
if (hasSubmitted == 0) {
hasSubmitted = 1;
divMsg.style.display ='block';
return true;
}
return false;
}
</SCRIPT>

...
THE SERVER ASPX.CS code has these...
-------------------------------------

private void btnSubmit_Click(object sender, System.EventArgs e)
{
bool valid = false;

// Do some validation

if ( valid ) {
triggerControl.Attributes.Add("onclick", "
NoDoubleSubmit();");
}

}

private void triggerControl_Click(object sender,
System.Web.UI.ImageClickEventArgs e)
{
Response.Redirect("ReportTran.aspx");
}

// the extra code above prevents submitting the form twice

Nov 19 '05 #1
5 3011
Take a look at:
http://blogs.crsw.com/mark/articles/642.aspx

One of the better and nicest looking ones I've seen.

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
http://openmymind.net/redirector.aspx?documentId=51 - Learn about AJAX!

"Anonieko" <an******@hotmail.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
Scenario:

This is a reporting scenario where it takes a while to get
back a response ( report page ) after submit.

I want my user to see some kind of temporary message like
'Processing...' or 'Waiting.. ' after I clicked on a SUBMIT
button to post a web form.
Here is one solution. Anyone who has better?

Create an image button in the page small enough and add a click event
handler for this image button which will redirect to the target page.
The trick is to trigger the click on via javascript on the submit event
handler.

ASPX page has
-------------

...

<P align="center">
<asp:button id="btnSubmit" runat="server" Text="Show
Report"></asp:button>
<BR>
<asp:ImageButton id="triggerControl" runat="server" Width="1px"
Height="1px" ImageUrl="img/unknown.gif" />
<SPAN id="Processing" style="DISPLAY: none">
Please wait while creating report...
</SPAN>
</P>

<SCRIPT type="text/javascript">
var hasSubmitted = 0;
function NoDoubleSubmit() {
var divMsg = document.getElementById('Processing');
if (hasSubmitted == 0) {
hasSubmitted = 1;
divMsg.style.display ='block';
return true;
}
return false;
}
</SCRIPT>

...
THE SERVER ASPX.CS code has these...
-------------------------------------

private void btnSubmit_Click(object sender, System.EventArgs e)
{
bool valid = false;

// Do some validation

if ( valid ) {
triggerControl.Attributes.Add("onclick", "
NoDoubleSubmit();");
}

}

private void triggerControl_Click(object sender,
System.Web.UI.ImageClickEventArgs e)
{
Response.Redirect("ReportTran.aspx");
}

// the extra code above prevents submitting the form twice

Nov 19 '05 #2

Karl Seguin wrote:
Take a look at:
http://blogs.crsw.com/mark/articles/642.aspx

One of the better and nicest looking ones I've seen.

Karl

Exactly what I need!!! Thanks you're a rock star!

Nov 19 '05 #3
How about another example that goes within the page itself ( and not on
top )
Thanks Again!

Nov 19 '05 #4
You can open a new window for the report so that it will run on a separate
process and you can still continue with other tasks.

"Anonieko" <an******@hotmail.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
Scenario:

This is a reporting scenario where it takes a while to get
back a response ( report page ) after submit.

I want my user to see some kind of temporary message like
'Processing...' or 'Waiting.. ' after I clicked on a SUBMIT
button to post a web form.
Here is one solution. Anyone who has better?

Create an image button in the page small enough and add a click event
handler for this image button which will redirect to the target page.
The trick is to trigger the click on via javascript on the submit event
handler.

ASPX page has
-------------

...

<P align="center">
<asp:button id="btnSubmit" runat="server" Text="Show
Report"></asp:button>
<BR>
<asp:ImageButton id="triggerControl" runat="server" Width="1px"
Height="1px" ImageUrl="img/unknown.gif" />
<SPAN id="Processing" style="DISPLAY: none">
Please wait while creating report...
</SPAN>
</P>

<SCRIPT type="text/javascript">
var hasSubmitted = 0;
function NoDoubleSubmit() {
var divMsg = document.getElementById('Processing');
if (hasSubmitted == 0) {
hasSubmitted = 1;
divMsg.style.display ='block';
return true;
}
return false;
}
</SCRIPT>

...
THE SERVER ASPX.CS code has these...
-------------------------------------

private void btnSubmit_Click(object sender, System.EventArgs e)
{
bool valid = false;

// Do some validation

if ( valid ) {
triggerControl.Attributes.Add("onclick", "
NoDoubleSubmit();");
}

}

private void triggerControl_Click(object sender,
System.Web.UI.ImageClickEventArgs e)
{
Response.Redirect("ReportTran.aspx");
}

// the extra code above prevents submitting the form twice

Nov 19 '05 #5
The samples for Chapter 3 should help :

http://www.daveandal.net/books/6744/samples.aspx

Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
"Anonieko" <an******@hotmail.com> wrote in message
news:11*********************@g14g2000cwa.googlegro ups.com...
How about another example that goes within the page itself ( and not on
top )
Thanks Again!

Nov 19 '05 #6

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

Similar topics

11
by: Jack | last post by:
I want to display a table on a page based on whether a button is pressed or not. I'm new at php so I'm sure I'm making a basic mistake. Here's what I am trying. My thought was that $show_summary...
2
by: belzibob | last post by:
I have inherited a table where each row is a <form> Each of these rows has only four columns, those being: 1) Item number 4) Quantity (blank textbox to fill in) 3) Description 4) Add link (to...
5
by: Bill Cohagan | last post by:
I'm constructing an ASP app with a frameset on the home html page. From frame A I need to referesh the page in frame B when a button click occurs on a button in Frame A (server side event handler)....
7
by: Steve Kallal | last post by:
I have seen this subject tossed around in this forum before. But in my case I need a simple solution. I do NOT need to show progress in terms on percentage complete. But rather I need to show a...
8
by: -Karl | last post by:
Apparently, asp.net has a posting issue with refreshing. There seems to be several solutions to the issue but I was wondering if there is a final workaround for the issue? If so, can you please...
8
by: Ed Jay | last post by:
I want to use history.go() to navigate between my previously loaded pages. I'm looking for a way to trigger a function call when a page is accessed using history.go(). Is there an event generated?...
2
by: Syam | last post by:
Hello everyone, I am just barely two months old into learning asp.net and vb.net. Currently I am working on a project to store customer database. I have a question about creating a preview page:...
4
by: Jono | last post by:
Hi Everyone, As it says in the title, I'm looking for a way to display a page while long running operations are performed on the server. Ideally, I'd like some way to push the current request...
1
by: ohagna | last post by:
in oracle form devoloper i tray to connect but get this error mesage : error mesage NO ORA12636 please what that mean ? ?
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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...
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...

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.