protected void Button_submit_Click(object sender, EventArgs e) { if (TextBox_sap.Text != "" && TextBox_name.Text != "" && DropDownList_branch.SelectedValue != "" && DropDownList_year.SelectedValue != "" && DropDownList_course.SelectedValue != "" && DropDownList_gender.SelectedValue != "" && TextBox_mobile_self.Text != "" && TextBox_mobile_parent.Text != "" && TextBox_email.Text != "" && TextBox_address.Text != "" && DropDownList_mentor.SelectedValue != "") { if (Page.IsValid) { //encrypt sap_id here String password = Encrypt(TextBox_sap.Text.Trim()); int i = Data_Access.Register_student(TextBox_sap.Text, TextBox_name.Text, password, DropDownList_branch.SelectedValue, DropDownList_year.SelectedValue, DropDownList_course.SelectedValue, DropDownList_gender.SelectedValue, TextBox_mobile_self.Text, TextBox_mobile_parent.Text, TextBox_email.Text, TextBox_address.Text, DropDownList_mentor.SelectedValue ); if (i == 2) { Response.Write("Successful"); } else if (i == 3) { Response.Write("SAP ID already registered"); } else { Response.Write("Unsuccessful"); } } } else { Response.Write("Enter all the fields"); } }