show a message to user (WebApplication)

M

Marcos MOS

Hi all,

I would like show a message to user when the function's result return
"false"... like this

....
if (! my_function(params))
showMessage("my string message");

so, How Can I do it? Like, send a window's message or opening an other
iexplorer sending the string message by parameter, like (in Javascript)
"window.open"...

thanks for all
Marcos
 
S

S. Justin Gengo

Marcos,

What information are you validating? If you can use the built in validation
controls they have a an option to show a validation summary either on the
page or in a pop up window.

If this isn't what you're looking for let me know. Your other option is to
write code on-the-fly to a window you open with javascript. I'll give you a
sample if you'd like.

--
S. Justin Gengo, MCP
Web Developer

Free code library at:
www.aboutfortunate.com

"Out of chaos comes order."
Nietzche
 
M

Marcos MOS

Hi,

thanks for your help...

so, I have a button im my aspx --> when the user click in that one, I do a
query in the database and if that returns a false result, like
if (myDataSet.Tables[0].Rows.Count > 1)
ShowMessage("User, you have already registered these
informations...")

Did you undertand me? That Message could be a window, or would be better if
I could show a simple message, like window.alert in JavaScript, but sending
my custom string message....

I'd like to receive your sample...

An other doubt, is... If I would like to do a question to user and depending
on the answer the Page do something, as follow the example:
if (showQuestion("Would you like to insert it?") == True)
this.insertFunction(params);

thanks a lot
Marcos
 
S

S. Justin Gengo

Marcos,

If the message is displayed to the user after a database query (which would
have to occurr on the server) a window.alert is the perfect way to go.

What you could do is attach it to an "onLoad" event in the body tag.

I have a bit of code on my website on how to do this.

Just go to www.aboutfortunate.com

The title you are looking for is: Use the "body" tag as a server control

If you filter the list for Web and VB.Net it will make it easier to find.
Sorry, but I haven't built the site's search function yet. But there isn't
much code in the library yet so it shouldn't be too hard to find.

--
S. Justin Gengo, MCP
Web Developer

Free code library at:
www.aboutfortunate.com

"Out of chaos comes order."
Nietzche
Marcos MOS said:
Hi,

thanks for your help...

so, I have a button im my aspx --> when the user click in that one, I do a
query in the database and if that returns a false result, like
if (myDataSet.Tables[0].Rows.Count > 1)
ShowMessage("User, you have already registered these
informations...")

Did you undertand me? That Message could be a window, or would be better if
I could show a simple message, like window.alert in JavaScript, but sending
my custom string message....

I'd like to receive your sample...

An other doubt, is... If I would like to do a question to user and depending
on the answer the Page do something, as follow the example:
if (showQuestion("Would you like to insert it?") == True)
this.insertFunction(params);

thanks a lot
Marcos


S. Justin Gengo said:
Marcos,

What information are you validating? If you can use the built in validation
controls they have a an option to show a validation summary either on the
page or in a pop up window.

If this isn't what you're looking for let me know. Your other option is to
write code on-the-fly to a window you open with javascript. I'll give
you
a
sample if you'd like.

--
S. Justin Gengo, MCP
Web Developer

Free code library at:
www.aboutfortunate.com

"Out of chaos comes order."
Nietzche
 

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
473,770
Messages
2,569,586
Members
45,084
Latest member
HansGeorgi

Latest Threads

Top