protected void btnReset_Click(object sender, EventArgs e) { BEAdmin objBEAdmin = new BEAdmin(); BAdmin objBAdmin = new BAdmin(); objBEAdmin.IntStudentID = Convert.ToInt32(Request.QueryString["StudentID"].ToString()); objBEAdmin.StrRandomPassword = GetRandomPassword(Length); objBAdmin.BUpdatePassword(objBEAdmin); if (objBEAdmin.IntResult == 1) { try { BEMail objBEMail = new BEMail(); BMail objBMail = new BMail(); objBEMail.IntUserID = objBEAdmin.IntStudentID; objBEMail.IntTransID = 0; objBEMail.StrTemplateName = BaseClass.EnumEmails.ForgotPassword.ToString(); objBMail.BSendEmail(objBEMail); } catch (Exception ex) { throw ex; } trMessage.Visible = true; lblInfo.Text = Resources.AppMessages.Admin_Reset_Success_Reset; lblInfo.ForeColor = System.Drawing.Color.FromName(Resources.AppConfigurations.Color_Success); ImgInfo.ImageUrl = Resources.AppConfigurations.Image_Success; tdInfo.Attributes.Add("style", Resources.AppConfigurations.Color_Table_Success); } else { trMessage.Visible = true; lblInfo.Text = Resources.AppMessages.Admin_Reset_Error_ResetStudent; lblInfo.ForeColor = System.Drawing.Color.FromName(Resources.AppConfigurations.Color_Error); ImgInfo.ImageUrl = Resources.AppConfigurations.Image_Error; tdInfo.Attributes.Add("style", Resources.AppConfigurations.Color_Table_Error); } }