Display success notification after form post

M

MCDONAMW

First off, forgive me for being such a noob. I typically program
vb.net, but I need to do some asp.net programming.

I have something simple I have no idea how to do!

I have an aspx page which is essentially a form containing a few text
boxes and a submit button.

The user types in the various fields, and hits the submit button.
This button fires off an email via smtp containing information from
those text boxes.

My question is.. can I verify the email was sent? I guess if there's
no error it was sent.

My next part of this is how to display to the user a message denoting
success.

As it stands, the form submits, and it just returns to the same form
with all of the information still there. I plan on clearing all of
the fields, but what I'd rather do is present a message, akin to a
messagebox popup, alerting the user that request was submitted.

This should be so easy yet I'm stumped. Should I be calling a
seperate asp page with nothing but "request submitted" as the text?
That seems like a waste. Hell even that I do not know how to do!

What are my options? Someone suggested using a panel, and hide/show,
etc. I tried putting my labels/textboxes into a panel and it did
nothing but mess the format up. The spacing was all messed up. Not
much drag and drop functionality with the panel. It seems more html
based when it comes to positioning.

I don't know what else to do.

Again sorry for the sheer ignorance on the subject. I just need some
guidance. (I'm not lookin to read a 1000 page book on asp.net just to
get this functionality). Thanks.

Matthew
 
S

Steve C. Orr [MVP, MCSD]

You can execute a line of code like this when you want a message box to be
displayed.
(This writes out the necessary client side javascript to your HTML page to
make the alert pop up as soon as the page is sent to their browser.)

RegisterStartupScript("startupScript", "<script
language=JavaScript>alert('This is my message.');</script>");

Here's more info:
http://msdn.microsoft.com/library/d...mWebUIPageClassRegisterStartupScriptTopic.asp

Here are a couple controls you might find to be useful:
http://www.metabuilders.com/Tools/ConfirmedButtons.aspx
http://www.jttz.com/msgbox/index.htm
 
M

MCDONAMW

Talk about a quick response!!!

Where do I paste that? Obviously to me that looks like the signature of
a function called RegisterStartupScript, but that function doesn't
exist.

Maybe I'm missing something or maybe I'm more of noob than I thought
with programming in general.

Remove underscores and nospam to email me directly.
 
S

Steve C. Orr [MVP, MCSD]

RegisterStartupScript is a method of the Page object.

You can put the code in your Page_Load event, or in pretty much any other
server side code.
 
M

MCDONAMW

Thanks for your quick help Steve. I'll give er a try and hopefully I
don't have to ask for anymore help!

Thanks again,
Matthew

**Remove underscores and nospam to email me directly.**
 

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

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,049
Latest member
Allen00Reed

Latest Threads

Top