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.

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

Member Avatar for stbuchok

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.