473,774 Members | 2,253 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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:ImageButto n id="triggerCont rol" 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.getEle mentById('Proce ssing');
if (hasSubmitted == 0) {
hasSubmitted = 1;
divMsg.style.di splay ='block';
return true;
}
return false;
}
</SCRIPT>

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

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

// Do some validation

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

}

private void triggerControl_ Click(object sender,
System.Web.UI.I mageClickEventA rgs e)
{
Response.Redire ct("ReportTran. aspx");
}

// the extra code above prevents submitting the form twice

Nov 19 '05 #1
5 3037
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******@hotma il.com> wrote in message
news:11******** **************@ z14g2000cwz.goo glegroups.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:ImageButto n id="triggerCont rol" 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.getEle mentById('Proce ssing');
if (hasSubmitted == 0) {
hasSubmitted = 1;
divMsg.style.di splay ='block';
return true;
}
return false;
}
</SCRIPT>

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

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

// Do some validation

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

}

private void triggerControl_ Click(object sender,
System.Web.UI.I mageClickEventA rgs e)
{
Response.Redire ct("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******@hotma il.com> wrote in message
news:11******** **************@ z14g2000cwz.goo glegroups.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:ImageButto n id="triggerCont rol" 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.getEle mentById('Proce ssing');
if (hasSubmitted == 0) {
hasSubmitted = 1;
divMsg.style.di splay ='block';
return true;
}
return false;
}
</SCRIPT>

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

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

// Do some validation

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

}

private void triggerControl_ Click(object sender,
System.Web.UI.I mageClickEventA rgs e)
{
Response.Redire ct("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******@hotma il.com> wrote in message
news:11******** *************@g 14g2000cwa.goog legroups.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
2316
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 would switch states with each click but it is coming up always true. So I'm guessing that is the default setting when the page loads. Can someone please point out where I am going wrong? if(isset($_POST)) { $show_summary = true; } else {
2
6332
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 add just this one item. That works fine but, now they want to have a submit button at the top of the page, that when clicked, will submit every form whose quantity
5
5191
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). To accomplish this I've included some client side script in the page being built in frame A such that whenever it is received by the browser it reloads frame B's page. The problem is that (sometimes) this sequence of events produces a dialog...
7
2538
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 visual indicator to the user that a process is running. There are two scenarios where I need to show a busy indicator: Scenario #: The first is when posting to the web server and waiting for a response.
8
1765
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 inform me what I need to do? I'm using ASP.NET 2.0 beta
8
2669
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? Is there a method for detecting what page the user came from when a page is accessed using history.go()? -- Ed Jay (remove M to respond by email)
2
4685
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: I have a main page that uses forms to input customer information such as name, contacts etc... Once all information is filled up, I would like to preview it irst before submitting to the database. On the main page, there should be a preview...
4
3268
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 onto some stack, where it would continue to be processed asynchronously (most importantly preserving things like view state, form post data, etc). In the interim, while the main request is processed, a friendly page will be displayed to the user....
1
5706
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 ? ?
0
10106
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10039
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8937
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7463
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6717
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5484
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4012
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3610
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2852
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.