protected void getCode_Click(object sender, EventArgs e) { if (email.Text.ToString().Trim() == null || string.Compare(mailTip.Style["display"].ToString(), "inline") == 0) { hdiv.Style.Add("display", "normal"); dis.Text = "注册失败!"; hdivUP.Update(); } else { try { Random random = new Random(); checkCode1 = random.Next(1111, 9999).ToString(); string reciver = email.Text.Trim(); string subject = "软件研发中心注册验证码"; string body = "您的注册验证码是" + checkCode1; MailHelper.SendMail(reciver, subject, body); this.checkCode.Focus(); } catch { this.Response.Write("<Script Language=JavaScript>alert('邮箱错误!');</Script>"); } } UP1.Update(); }
protected void txtFAcultySearch_TextChanged(object sender, EventArgs e) { DataTable dt = CourseRegManager.GetFAcultyNAme(txtFAcultySearch.Text); txtFAcultySearch.Text = dt.Rows[0]["FacultyName"].ToString(); lblFacultyID.Text = dt.Rows[0]["ID"].ToString(); UP1.Update(); }
protected void Unnamed_Click(object sender, EventArgs e) { error = Check.InfCheck(name.Text.ToString().Trim(), email.Text.ToString().Trim(), policeNum.Text.ToString().Trim()); if (error[0] == 1) { nameTip.Style.Add("display", "inline"); UP1.Update(); } else { nameTip.Style.Add("display", "none"); UP1.Update(); } if (error[1] == 1) { mailTip.Style.Add("display", "inline"); UP3.Update(); } else { mailTip.Style.Add("display", "none"); UP3.Update(); } if (error[2] == 1) { policeNumTip.Style.Add("display", "inline"); UP2.Update(); } else { policeNumTip.Style.Add("display", "none"); UP2.Update(); } if (error[0] == 1 || error[1] == 1 || error[2] == 1) { confirm.Style.Add("display", "none"); UPelse.Update(); } else { confirm.Style.Add("display", "normal"); UPelse.Update(); } }