1 <%@ Page Language="C#" AutoEventWireup="true"
2 CodeFile="Register.aspx.cs" Inherits="User_Register" %>
3
4 DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
5 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
6
7 <html xmlns="http://www.w3.org/1999/xhtml" >
8 <head runat="server">
9 <title>제목 없음title>
10 <script language="javascript" type="text/javascript">
11 function CheckUserID(source, args)
12 {
13 var a = args.Value;
14 if (a.length < 3 || a.length > 12)
15 {
16 args.IsValid = false;
17 }
18 else
19 {
20 args.IsValid = true;
21 }
22 }
23 script>
24 head>
25 <body>
26 <form id="form1" runat="server">
27 <div>
28 회원가입<br />
29 <br />
30 <table style="width: 500px;">
31 <tr>
32 <td style="width: 75px">
33 아이디:td>
34 <td>
35 <asp:TextBox ID="txtUserID" runat="server">asp:TextBox>
36 <asp:RequiredFieldValidator ID="valUserID" runat="server"
37 ControlToValidate="txtUserID" ErrorMessage="아이디를 입력하시오."
38 Display="None" SetFocusOnError="True">asp:RequiredFieldValidator>
39 <asp:CustomValidator ID="valUserIDLength" runat="server"
40 ControlToValidate="txtUserID"
41 ErrorMessage="아이디는 3자 이상 12자 이하로 입력하시오."
42 ClientValidationFunction="CheckUserID"
43 OnServerValidate="valUserIDLength_ServerValidate" Display="None"
44 SetFocusOnError="True">asp:CustomValidator>td>
45 tr>
46 <tr>
47 <td style="width: 75px; height: 27px;">
48 암호:td>
49 <td style="height: 27px">
50 <asp:TextBox ID="txtPassword" runat="server"
51 TextMode="Password">asp:TextBox>
52 <asp:RequiredFieldValidator ID="valPassword" runat="server"
53 ControlToValidate="txtPassword"
54 ErrorMessage="암호를 입력하시오." Display="None"
55 SetFocusOnError="True">asp:RequiredFieldValidator>td>
56 tr>
57 <tr>
58 <td style="width: 75px; height: 27px">
59 암호확인:td>
60 <td style="height: 27px">
61 <asp:TextBox ID="txtPasswordConfirm" runat="server"
62 TextMode="password">asp:TextBox>
63 <asp:CompareValidator ID="valPasswordConfirm" runat="server"
64 ControlToCompare="txtPasswordConfirm"
65 ControlToValidate="txtPassword" ErrorMessage="암호가 틀렸습니다."
66 Display="None" SetFocusOnError="True">asp:CompareValidator>td>
67 tr>
68 <tr>
69 <td style="width: 75px">
70 이름:td>
71 <td>
72 <asp:TextBox ID="txtUserName" runat="server">asp:TextBox>
73 <asp:RequiredFieldValidator ID="valUserName" runat="server"
74 ErrorMessage="이름을 입력하시오."
75 ControlToValidate="txtUserName" Display="None"
76 SetFocusOnError="True">asp:RequiredFieldValidator>td>
77 tr>
78 <tr>
79 <td style="width: 75px">
80 이메일:td>
81 <td>
82 <asp:TextBox ID="txtEmail" runat="server">asp:TextBox>
83 <asp:RegularExpressionValidator ID="valEmail" runat="server"
84 ControlToValidate="txtEmail"
85 ErrorMessage="이메일을 정확히 입력하시오."
86 ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"
87 Display="None" SetFocusOnError="True">
88 asp:RegularExpressionValidator>td>
89 tr>
90 <tr>
91 <td style="width: 75px">
92 직업:td>
93 <td>
94 <asp:DropDownList ID="lstJob" runat="server">
95 <asp:ListItem>회사원asp:ListItem>
96 <asp:ListItem Selected="True">학생asp:ListItem>
97 <asp:ListItem>주부asp:ListItem>
98 asp:DropDownList>td>
99 tr>
100 <tr>
101 <td style="width: 75px">
102 취미:td>
103 <td>
104 <asp:CheckBoxList ID="chkHobby" runat="server"
105 RepeatDirection="Horizontal" RepeatLayout="Flow">
106 <asp:ListItem>농구asp:ListItem>
107 <asp:ListItem>축구asp:ListItem>
108 <asp:ListItem>배구asp:ListItem>
109 asp:CheckBoxList>td>
110 tr>
111 <tr>
112 <td style="width: 75px">
113 성별:td>
114 <td>
115 <asp:RadioButtonList ID="optGender" runat="server"
116 RepeatDirection="Horizontal" RepeatLayout="Flow">
117 <asp:ListItem Value="0">남자asp:ListItem>
118 <asp:ListItem Selected="True" Value="1">여자asp:ListItem>
119 asp:RadioButtonList>td>
120 tr>
121 <tr>
122 <td style="width: 75px">
123 생년월일:td>
124 <td>
125 <asp:TextBox ID="txtYear" runat="server">asp:TextBox>
126 <asp:RangeValidator ID="valYear" runat="server"
127 ControlToValidate="txtYear" ErrorMessage="1900~2007 사이의
숫자를 입력하시오."
128 MaximumValue="2007" MinimumValue="1900" Type="Integer"
129 Display="None" SetFocusOnError="True">asp:RangeValidator>td>
130 tr>
131 <tr>
132 <td style="width: 75px">
133 소개:td>
134 <td>
135 <asp:TextBox ID="txtIntro" runat="server" TextMode="MultiLine">
136 asp:TextBox>td>
137 tr>
138 <tr>
139 <td colspan="2">
140 <asp:Button ID="btnRegister" runat="server"
141 Text="회원가입" OnClick="btnRegister_Click" />
142 <asp:Button ID="btnCancel" runat="server" Text="취소"
143 OnClick="btnCancel_Click" CausesValidation="False" />td>
144 tr>
145 table>
146 <br />
147 <asp:Label ID="lblDisplay" runat="server" Text="">asp:Label>
148 <br />
149 <asp:ValidationSummary ID="valSummary" runat="server"
150 ShowMessageBox="True" ShowSummary="False" />
151 div>
152 form>
153 body>
154 html>
155