protected void btnSave_Click(object sender, EventArgs e) { if (Page.IsValid) { if (ddlSecurityQuestion1.SelectedIndex == 0 || ddlSecurityQuestion2.SelectedIndex == 0 || ddlSecurityQuestion3.SelectedIndex == 0) { lblSecUpdated.Text = "<img src='../Images/no.png'align='middle'/> <font color='red'>" + Resources.ResMessages.Student_MyprofileAllthreequestions + "</font>"; } else if (txtAnswer1.Text == string.Empty || txtAnswer1.Text == "N/A" || txtAnswer2.Text == "" || txtAnswer2.Text == "N/A" || txtAnswer3.Text == "" || txtAnswer3.Text == "N/A") { lblSecUpdated.Text = "<img src='../Images/no.png'align='middle'/> <font color='red'>" + Resources.ResMessages.Student_MyprofileAllthreeAnswers + "</font>"; } else if (ddlSecurityQuestion1.SelectedValue == ddlSecurityQuestion2.SelectedValue || ddlSecurityQuestion2.SelectedValue == ddlSecurityQuestion3.SelectedValue || ddlSecurityQuestion1.SelectedValue == ddlSecurityQuestion3.SelectedValue) { lblSecUpdated.Text = "<img src='../Images/no.png'align='middle'/> <font color='red'>" + Resources.ResMessages.Student_MyprofilethreeDifferentQuestions + "</font>"; } else { BEStudent objBEStudent = new BEStudent(); BStudent objBStudent = new BStudent(); objBEStudent.IntUserID = Convert.ToInt32(Session[BaseClass.EnumPageSessions.USERID]); objBEStudent.strQuestion1 = ddlSecurityQuestion1.SelectedValue; objBEStudent.strQuestion2 = ddlSecurityQuestion2.SelectedValue; objBEStudent.strQuestion3 = ddlSecurityQuestion3.SelectedValue; if (txtAnswer1.Text != "N/A") { objBEStudent.strAnswer1 = txtAnswer1.Text; } if (txtAnswer2.Text != "N/A") { objBEStudent.strAnswer2 = txtAnswer2.Text; } if (txtAnswer3.Text != "N/A") { objBEStudent.strAnswer3 = txtAnswer3.Text; } objBStudent.BUpdateSecurityQuestions(objBEStudent); if (objBEStudent.IntResult > 0) { lblSecUpdated.Text = "<img src='../Images/yes.png'align='middle'/> <font color='#00C000'>" + Resources.ResMessages.MyProfile_SecquestionsUpdateSuccess + "</font>"; lblsucc.Visible = false; trSecurityQuestionsView.Visible = true; trSecurityQuestionsEdit.Visible = false; BindSecurityQuestions(); } } } ValidatePhotoIdentity(); ScriptManager.RegisterStartupScript(this, this.GetType(), "NotSaved", "document.getElementById('" + lblSecUpdated.ClientID.ToString() + "').focus();", true); }