<%@ Import Namespace="System.Web.Mail" %> <%-- The line above is the namespace for the mail sending functions. This is very important!!! Don't forget it when sending mail like this. --%> <%-- The tag below starts our server-side scripting. Notice the runat="server" parameter. That's important. --%> tag --%> <%-- this will all be displayed when the user first comes to this page --%> Email stuff <%-- Notice this form tag. It's special. It has "runat=server". Why? well because it will execute itself. Meaning it will automatically set "method=post and action="email.aspx." This tag also keeps state for us. --%>
<%-- "Your E-mail address is regular html text. Nothing is special about that. If you notice after it, its using some "asp" tag. This is the ASP webcontrol for the textbox. ID is the same thing as name. columns would be the length in characters and don't forget the "runat=server" or it will not work. Notice how we set the id of this control equal to txtemail. Remember we called "txtemail.text" in the subroutine above this? That will retrieve all information submited in that. --%> Your E-mail Address: <%-- The following two classes below validate the input. The first control entitled "asp:regularexpressionvalidator" will validate the control stated in the "controltovalidate" parameter for proper format. The "text" parameter is the error message that I have chosen to display. The validationexpression parameter is the actual expression we are using to validate it. In order to learn this, you should read up on it. It's quite complex. The next control (asp:requiredfieldvalidator) will make sure something was entered in the controltovalidate parameter. The parameters are almost the same as the other one. These techniques require is Javascript enabled browser to work on the client-side. If the visitor doesn't have one, then it will process automatically on the server-side and return the errors. --%>

Comments:
<%-- The next control is the same as the previous textboxes except for the textmode is set to multiline and the rows are set to 10. This is so we can get a textarea field instead of a small textbot. You can modify the sizes to whatever you want. The control below this one is another "requiredfieldvalidator" control. The difference is that the controltovalidate parameter is set to the control "comments" to make sure comments were entered. --%>

<%-- Finially, this is the button control. Take a look at the parameters. The "text" parameter is set to submit. This will be the text that is actually visible on the button. (ex. Submit, Send Mail!, Send!..etc) The onclick parameter is set to "button_click." This means that once this is clicked, the server will run the subroutine "button_click." (We defined this already. It's at the very top of this page.) And, runat=server is set so it will work. --%>

<%-- I hope this was helpful. If you have any problems, let me know. (webmaster@sourcecode-central.com) --%>