Client popup dialog based on server side logic

G

Guest

I have an asp.net application written in c# and in many cases when the user
submits a form or causes a postback there could be significant processing
(logic) required which results in a message being displayed to the user.

After processing server side I register a script with the clientside to use
alert('message');
to display the user message.

The problem I have is that this message will show again if the user leaves
the page and returns using the back button. How can I display the message
only once ?
 
G

Guest

In the client script do something like this:

--script tag
var windowshown = 0;

function myfunc(){
if (windowshown == 0){
windowshown = 1;
msgbox('hello');
}
}
--end script tag
 
G

Guest

As I am registering the script block as a startup script the variable
windowshown would be reset to 0 and the message shown everytime the page was
refreshed ?

Simon.
 

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

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top