Hi,
I want to create a popup to notify a user that the server side process
has completed successfully. I intended to use a javascript alert to do
this, although ideally the icon should be different, but thats another
story . . .
Anyway, on successful completion of the process i use this piece of
code:
Response.Write("<script language=javascript>alert('Process completed
successfully!');</script>");
Which works OK, but if the page is refreshed afterwards the whole
server side process is launched again, resulting in the message box
appearing again.
Is there any way to prevent this? Or an alternative way to achieve the
same results?
Many thanks 7 2802
Off Course. I deduct that you are using ASP.NET technologies. So first you
need to put this script (the response) into the Page_Load event. After this
put the response into an if statment and check the isPostBack Property of the
page ...
--
Raffaele Garofalo
Application Developer
MCP
"Assimalyst" wrote:
Hi,
I want to create a popup to notify a user that the server side process
has completed successfully. I intended to use a javascript alert to do
this, although ideally the icon should be different, but thats another
story . . .
Anyway, on successful completion of the process i use this piece of
code:
Response.Write("<script language=javascript>alert('Process completed
successfully!');</script>");
Which works OK, but if the page is refreshed afterwards the whole
server side process is launched again, resulting in the message box
appearing again.
Is there any way to prevent this? Or an alternative way to achieve the
same results?
Many thanks
Thanks for the suggestion Raffaele, but it doesn't seem to work.
I have placed it in a if post back statement like so:
if (Page.IsPostBack)
{
Response.Write("<script language=javascript>alert('Process
completed');</script>");
}
So it is shows on postback, but when i refresh the page it seems to be
treated as a postback and runs the code again??
Am i missing something?
Any other suggestions?
Thanks
Raffaeu wrote:
Off Course. I deduct that you are using ASP.NET technologies. So first you
need to put this script (the response) into the Page_Load event. After this
put the response into an if statment and check the isPostBack Property of the
page ...
--
Raffaele Garofalo
Application Developer
MCP
"Assimalyst" wrote:
Hi,
I want to create a popup to notify a user that the server side process
has completed successfully. I intended to use a javascript alert to do
this, although ideally the icon should be different, but thats another
story . . .
Anyway, on successful completion of the process i use this piece of
code:
Response.Write("<script language=javascript>alert('Process completed
successfully!');</script>");
Which works OK, but if the page is refreshed afterwards the whole
server side process is launched again, resulting in the message box
appearing again.
Is there any way to prevent this? Or an alternative way to achieve the
same results?
Many thanks
"Assimalyst" <c_******@hotmail.comwrote in message
news:11**********************@h48g2000cwc.googlegr oups.com...
So it is shows on postback, but when i refresh the page it seems to be
treated as a postback and runs the code again??
Am i missing something?
Yes - refreshing the page performs the last action on that page, so if the
last action was a postback, refreshing the page will run the postback
again...
Very strange because you need to check in Page_Load event if the page is
PostBacked or not and show the Popup only 1 time ...
Mmm you can try to work with Session maybe and check it.
--
Raffaele Garofalo
Application Developer
MCP
"Assimalyst" wrote:
Thanks for the suggestion Raffaele, but it doesn't seem to work.
I have placed it in a if post back statement like so:
if (Page.IsPostBack)
{
Response.Write("<script language=javascript>alert('Process
completed');</script>");
}
So it is shows on postback, but when i refresh the page it seems to be
treated as a postback and runs the code again??
Am i missing something?
Any other suggestions?
Thanks
Raffaeu wrote:
Off Course. I deduct that you are using ASP.NET technologies. So first you
need to put this script (the response) into the Page_Load event. After this
put the response into an if statment and check the isPostBack Property of the
page ...
--
Raffaele Garofalo
Application Developer
MCP
"Assimalyst" wrote:
Hi,
>
I want to create a popup to notify a user that the server side process
has completed successfully. I intended to use a javascript alert to do
this, although ideally the icon should be different, but thats another
story . . .
>
Anyway, on successful completion of the process i use this piece of
code:
>
Response.Write("<script language=javascript>alert('Process completed
successfully!');</script>");
>
Which works OK, but if the page is refreshed afterwards the whole
server side process is launched again, resulting in the message box
appearing again.
>
Is there any way to prevent this? Or an alternative way to achieve the
same results?
>
Many thanks
>
>
Yep, using sessions is my next plan thanks.
Yes - refreshing the page performs the last action on that page, so if the
last action was a postback, refreshing the page will run the postback
again...
Is there any way to refresh the page without running the last performed
task?
Thanks again.
Raffaeu wrote:
Very strange because you need to check in Page_Load event if the page is
PostBacked or not and show the Popup only 1 time ...
Mmm you can try to work with Session maybe and check it.
--
Raffaele Garofalo
Application Developer
MCP
"Assimalyst" wrote:
Thanks for the suggestion Raffaele, but it doesn't seem to work.
I have placed it in a if post back statement like so:
if (Page.IsPostBack)
{
Response.Write("<script language=javascript>alert('Process
completed');</script>");
}
So it is shows on postback, but when i refresh the page it seems to be
treated as a postback and runs the code again??
Am i missing something?
Any other suggestions?
Thanks
Raffaeu wrote:
Off Course. I deduct that you are using ASP.NET technologies. So first you
need to put this script (the response) into the Page_Load event. After this
put the response into an if statment and check the isPostBack Property of the
page ...
--
Raffaele Garofalo
Application Developer
MCP
>
>
"Assimalyst" wrote:
>
Hi,
I want to create a popup to notify a user that the server side process
has completed successfully. I intended to use a javascript alert to do
this, although ideally the icon should be different, but thats another
story . . .
Anyway, on successful completion of the process i use this piece of
code:
Response.Write("<script language=javascript>alert('Process completed
successfully!');</script>");
Which works OK, but if the page is refreshed afterwards the whole
server side process is launched again, resulting in the message box
appearing again.
Is there any way to prevent this? Or an alternative way to achieve the
same results?
Many thanks
"Assimalyst" <c_******@hotmail.comwrote in message
news:11**********************@k70g2000cwa.googlegr oups.com...
>Yes - refreshing the page performs the last action on that page, so if the last action was a postback, refreshing the page will run the postback again...
Is there any way to refresh the page without running the last performed
task?
Not as far as I know, though you might get a more definitive answer on
microsoft.public.dotnet.framework.aspnet
No this is not possible.
--
________________________
Warm regards,
Alvin Bruney [MVP ASP.NET]
[Shameless Author plug]
Professional VSTO.NET - Wrox/Wiley
The O.W.C. Black Book with .NET www.lulu.com/owc, Amazon
Blog: http://www.msmvps.com/blogs/alvin
-------------------------------------------------------
"Mark Rae" <ma**@markNOSPAMrae.comwrote in message
news:er**************@TK2MSFTNGP03.phx.gbl...
"Assimalyst" <c_******@hotmail.comwrote in message
news:11**********************@k70g2000cwa.googlegr oups.com...
>>Yes - refreshing the page performs the last action on that page, so if the last action was a postback, refreshing the page will run the postback again...
Is there any way to refresh the page without running the last performed task?
Not as far as I know, though you might get a more definitive answer on
microsoft.public.dotnet.framework.aspnet This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Kevin Lyons |
last post by:
Hello,
I am trying to get my select options (courses) passed correctly from
the following URL: http://www.dslextreme.com/users/kevinlyons/selectBoxes.html
I am having difficulty getting the...
|
by: Andy Fish |
last post by:
Hi,
I want to use an anchor tag to invoke some javascript and I've read that
it's bad form to use <a href="javascript:foo()">
I've read endless usenet posts and hint sites on the net, they all...
|
by: dmiller23462 |
last post by:
Hi guys....I have absolutely NO IDEA what I'm doing with Javascript
but my end result is I need two text boxes to stay hidden until a
particular option is selected....I've cobbled together the...
|
by: Dan |
last post by:
Hi
Does anyone know of a good Javascript typewriter ticker that allows
you to insert HTML into the ticker. I have found lots but when HTML is
inserted, the ticker pauses at the point it reaches...
|
by: Matt Kruse |
last post by:
http://www.JavascriptToolbox.com/bestpractices/
I started writing this up as a guide for some people who were looking for
general tips on how to do things the 'right way' with Javascript. Their...
|
by: |
last post by:
Hi all,
Has anyone been able to write some custom javascript on the onclick event of
submit button to do certain things like disable submit button, only submit
form once etc. This was a breeze...
|
by: @sh |
last post by:
I know this is probably a real simple one, but I'm obviously missing
something..
I'm building a function that I'll use throughout a website in the situation
that I have two text boxes - the two...
|
by: ozzy.osborn |
last post by:
Hello All,
I have been struggling with a cross browser solution to loading
external javascript files on the fly.
I have been successful using the following code in IE6:
var newScr =...
|
by: twigster |
last post by:
Hey everyone,
I'm looking for a good way to obfuscate some Javascript code. Does
anyone have a good experience or bad experience with a particular software?
thanks
|
by: DolphinDB |
last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation.
Take...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: PapaRatzi |
last post by:
Hello,
I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
|
by: Defcon1945 |
last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
|
by: Shællîpôpï 09 |
last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
|
by: af34tf |
last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
|
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...
| |