Our original Contact Form was based on the standard ASP spaghetti code posting back to itself and using the ASPMail component.
This was definitley one of those instances where I got tired of reading pretty quickly. It seems there are many, many options when creating forms, checkboxes, and emails with .NET
I read these two simple articles and sample files and went about rewriting this page pretty quickly, using some of the knowledge I had already picked up in the previous articles.
CheckBoxList Web Server Control
How to send an email in ASP.net
The second article there was simply this easy ASP.NET Email script
While this was useful, it didn't answer all my issues, just got me started. I also picked up that I didn't have to use the StringBuilder Class in order to build up a string as I had thought before. This time I simply used
So in essense my previous example of how to build a string could now also be
This made a lot more sense to me
Not sure if i used all the proper techniques here, but I essentially put the entire form inside <asp:label ID=contactForm></asp:label>
Then a Thank You Message in another label tag.
the "If.IsPostBack" means "If the user has posted"... I think you'll get the rest
Anyways here's the code I ended up with
And here's a cleaner copy of almost the same thing, but with less emphasis on design and fewer fields