954,593 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

A Contact Us Email Form

Hi,

I am building a Contact Us Email Form. My email sending part is working fine. I just want to confirm one thing with experienced programmers. Once I click the send message button, I am calling a function to send the mail. Then I get the message saying the mail has been sent. But all the text boxes in the page are still populated with values. I dont want to disable viewstate because, if there is an error in sending mail, i would like the textboxes to retain values. So the solution that i have thought out is to reset the text in all textboxes to "", if message sending has been successful. Is it a good idea or is there any better way to do this.

Thank you for your replies.

binoy.mathew
Newbie Poster
8 posts since Sep 2008
Reputation Points: 10
Solved Threads: 1
 

Yup this is good, if message is sent successfully, clear all control's values else retain them.

sufyan2011
Junior Poster
166 posts since Dec 2011
Reputation Points: 9
Solved Threads: 20
 

That sounds fine, you could also just do a Response.Redirect to the same page (It's a lot less code)

stbuchok
Master Poster
730 posts since May 2011
Reputation Points: 120
Solved Threads: 93
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: