📄 register.aspx
字号:
<!-- #INCLUDE Virtual="~/site/includes/header.aspx" -->
<script language="C#" runat=server>
bool blnIsResume;
void Page_Load(Object sender , EventArgs e)
{
string strReturnURL;
if (! IsPostBack )
{
strReturnURL = Request.QueryString[ "ReturnURL" ];
{
blnIsResume = true;
}
DataBind();
}
}
void Button_Click( object s, EventArgs e ) {
SqlConnection conJobs;
string strConString;
SqlCommand cmdInsert;
SqlParameter parmReturn;
if ( IsValid ) {
strConString = ConfigurationSettings.AppSettings[ "constring" ];
conJobs = new SqlConnection( strConString );
cmdInsert = new SqlCommand( "addUser", conJobs );
cmdInsert.CommandType = CommandType.StoredProcedure;
parmReturn = cmdInsert.Parameters.Add( "@return", SqlDbType.Int );
parmReturn.Direction = ParameterDirection.ReturnValue;
cmdInsert.Parameters.Add( "@username", txtUsername.Text );
cmdInsert.Parameters.Add( "@password", txtPassword.Text );
cmdInsert.Parameters.Add( "@firstname", txtFirstname.Text );
cmdInsert.Parameters.Add( "@lastname", txtLastname.Text );
cmdInsert.Parameters.Add( "@email", txtEmail.Text );
cmdInsert.Parameters.Add( "@briefdesc", txtBriefDesc.Text );
cmdInsert.Parameters.Add( "@fulldesc", txtFullDesc.Text );
cmdInsert.Parameters.Add( "@isresume", pnlResume.Visible );
conJobs.Open();
cmdInsert.ExecuteNonQuery();
conJobs.Close();
if ((int)cmdInsert.Parameters["@Return"].Value == 0) {
if (pnlResume.Visible)
Cache.Remove( "NewResumes" );
FormsAuthentication.RedirectFromLoginPage( txtUsername.Text, false );
} else {
lblError.Visible = true;
}
}
}
</Script>
<myControls:Header
PageTitle="Register"
Runat="Server" />
<h3>Please Register</h3>
<form runat="Server">
<table border=0 width="400">
<tr><td>
<asp:Label
ID="lblError"
forecolor="red"
font-bold="True"
Visible="False"
Runat="Server">
The username that you entered has already been selected
by another user. Please enter a new username.
<p>
</asp:Label>
<b>First Name</b>
<br>
<asp:TextBox
ID="txtFirstname"
Maxlength="30"
CssClass="formfield"
Runat="Server" />
<asp:RequiredFieldValidator
ControlToValidate="txtFirstname"
Text="Required!"
Runat="Server" />
<p>
<b>Last Name</b>
<br>
<asp:TextBox
ID="txtLastname"
Maxlength="30"
CssClass="formfield"
Runat="Server" />
<asp:RequiredFieldValidator
ControlToValidate="txtLastname"
Text="Required!"
Runat="Server" />
<p>
<b>Email Address</b>
<br>
<asp:TextBox
ID="txtEmail"
Maxlength="255"
Columns="50"
CssClass="formfield"
Runat="Server" />
<asp:RequiredFieldValidator
ControlToValidate="txtEmail"
Text="Required!"
Runat="Server" />
<p>
<b>Username</b>
<br>
<asp:TextBox
ID="txtUsername"
Maxlength="20"
CssClass="formfield"
Runat="Server" />
<asp:RequiredFieldValidator
ControlToValidate="txtUsername"
Text="Required!"
Runat="Server" />
<p>
<b>Password</b>
<br>
<asp:TextBox
ID="txtPassword"
Maxlength="20"
TextMode="Password"
CssClass="formfield"
Runat="Server" />
<asp:RequiredFieldValidator
ControlToValidate="txtPassword"
Text="Required!"
Runat="Server" />
<p>
<b>Password (Again for confirmation)</b>
<br>
<asp:TextBox
ID="txtPassword2"
Maxlength="20"
TextMode="Password"
CssClass="formfield"
Runat="Server" />
<asp:RequiredFieldValidator
ControlToValidate="txtPassword2"
Text="Required!"
Display="Dynamic"
Runat="Server" />
<asp:CompareValidator
ControlToValidate = "txtPassword"
ControlToCompare = "txtPassword2"
Type = "String"
Operator="Equal"
Text="Passwords must match!"
Runat = "Server" />
<p>
<asp:Panel
Visible='<%# !blnIsResume %>'
Runat="Server">
<b>Company Brief Description</b>
<br>
Enter a brief description of your company. This description
will appear on the page that lists links to your current
job postings.
</asp:Panel>
<asp:Panel
Visible='<%# blnIsResume %>'
Runat="Server">
<b>Brief Description</b>
<br>
Enter a brief description of the type of job that you are seeking.
</asp:Panel>
<br>
<asp:TextBox
ID="txtBriefDesc"
Maxlength="50"
Columns="50"
CssClass="formfield"
Runat="Server" />
<p>
<asp:Panel
ID="pnlCompany"
Visible='<%# !blnIsResume %>'
Runat="Server">
<b>Company Full Description</b>
<br>
Enter a full description of your company. This description
will appear on the page that lists links to your current
job postings. This description can contain HTML formatting.
</asp:Panel>
<asp:Panel
ID="pnlResume"
Visible='<%# blnIsResume %>'
Runat="Server">
<b>Resume</b>
<br>
Enter your resume. Your resume will appear on your personal home page.
Your resume can contain HTML formatting.
</asp:Panel>
<br>
<asp:TextBox
ID="txtFullDesc"
TextMode="Multiline"
Columns="80"
Rows="10"
CssClass="formfield"
Runat="Server" />
<p>
<asp:Button
Text="Register!"
OnClick="Button_Click"
Runat="Server" />
</td></tr>
</table>
</form>
<myControls:Footer
Runat="Server" />
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -