This repository has been archived by the owner on Feb 8, 2018. It is now read-only.
/
registration.aspx
61 lines (48 loc) · 1.93 KB
/
registration.aspx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<!-- #include virtual="header.inc" -->
<form runat="server">
<script runat="server">
void Page_Load ()
{
if (!IsPostBack){
return;
}
Page.Validate ();
string token = InsertData (name.Text, email.Text, country.Text, comments.Text);
mail (email.Text, token);
Response.Redirect ("thanks.aspx");
}
static void mail (string recipient, string token)
{
MailMessage m = new MailMessage ();
m.From = "monomeeting@gmail.com";
m.To = recipient;
m.Subject = "Mono Meeting 2006 Registration Information";
m.Body = String.Format ("\n\nHello,\n\n" +
"To complete your registration for the Mono Meeting 2006, please go to the\n" +
"following address\n\n\thttp://www.go-mono.com/meeting/confirm.aspx?token={0}\n\n" +
"To find more about the Mono Meeting, visit:\n\n\thttp://www.go-mono.com/meeting\n\n" +
"The Mono Team (mono@novell.com)", token);
SmtpMail.SmtpServer = "localhost";
SmtpMail.Send (m);
}
</script>
<div id="column-content">
<h2>Mono Meeting Registration</h2>
<p>Please enter the following information to register for the
Mono Meeting, the information obtained here will not be used for marketing purposes.
<p>Name:<br>
<asp:TextBox id="name" columns="50" runat="server" maxLength="100" />
<asp:RequiredFieldValidator runat="server" class="errorst" ControlToValidate="name" ErrorMessage="Please enter your name."/>
<p>Email:<br>
<asp:TextBox id="email" columns="50" runat="server" maxLength="100"/>
<asp:RegularExpressionValidator runat="server" ControlToValidate="email"
ValidationExpression="[\w\.\-]+@[a-zA-Z0-9\-]+(\.[a-zA-Z0-9\-]+)*(\.[a-zA-Z]{2,3}){1,2}"
ErrorMessage="Please enter your email address."/>
<p>Country:<br>
<asp:TextBox id="country" columns="50" runat="server" maxLength="100"/>
<p>Comments:<br>
<asp:TextBox id="comments" columns="70" rows="8" TextMode="multiline" runat="server" maxLength="1024"/>
<p>
<asp:button type="submit" runat="server" Text="Register" />
</form>
</div>