private void reset() { TextBox2.Text = ""; TextBox3.Text = ""; TextBox4.Text = ""; TextBox5.Text = ""; TextBox6.Text = ""; TextBox7.Text = ""; TextBox8.Text = ""; TextBox9.Text = ""; TextBox10.Text = ""; TextBox11.Text = ""; TextBox15.Text = ""; TextBox16.Text = ""; TextBox17.Text = ""; TextBox18.Text = ""; TextBox19.Text = ""; RadioButtonList1.ClearSelection(); RadioButtonList2.ClearSelection(); RadioButtonList3.ClearSelection(); RadioButtonList5.ClearSelection(); DropDownList1.SelectedIndex = 0; DropDownList2.SelectedIndex = 0; DropDownList3.SelectedIndex = 0; DropDownList5.SelectedIndex = 0; }
protected void btnClear_Click(object sender, EventArgs e) { RadioButtonList1.ClearSelection(); RadioButtonList2.ClearSelection(); RadioButtonList3.ClearSelection(); RadioButtonList4.ClearSelection(); RadioButtonList5.ClearSelection(); }
protected void Btn4Reset_Click(object sender, EventArgs e) { Preguntas.ActiveViewIndex = 0; RadioButtonList1.ClearSelection(); RadioButtonList2.ClearSelection(); RadioButtonList3.ClearSelection(); RadioButtonList4.ClearSelection(); RadioButtonList5.ClearSelection(); lbResultado.Text = ""; lbResultado.Visible = false; }
protected void btnSubmit_Click(object sender, EventArgs e) { sComplete.CompletedSurveyID = count++; sComplete.CompletedSurveyName = ddlSurveyList.Text; sComplete.Answer1 = RadioButtonList1.SelectedValue; sComplete.Answer2 = RadioButtonList2.SelectedValue; sComplete.Answer3 = RadioButtonList3.SelectedValue; sComplete.Answer4 = RadioButtonList4.SelectedValue; sComplete.Answer5 = RadioButtonList5.SelectedValue; sComplete.Question1 = lblQuestion1.Text; sComplete.Question2 = lblQuestion2.Text; sComplete.Question3 = lblQuestion3.Text; sComplete.Question4 = lblQuestion4.Text; sComplete.Question5 = lblQuestion5.Text; if (sComplete.Answer1 != string.Empty && sComplete.Answer2 != string.Empty && sComplete.Answer3 != string.Empty && sComplete.Answer4 != string.Empty && sComplete.Answer5 != string.Empty) { lblSaved.Visible = true; ddlSurveyList.SelectedIndex = 0; lblQuestion1.Visible = false; lblQuestion2.Visible = false; lblQuestion3.Visible = false; lblQuestion4.Visible = false; lblQuestion5.Visible = false; RadioButtonList1.Visible = false; RadioButtonList2.Visible = false; RadioButtonList3.Visible = false; RadioButtonList4.Visible = false; RadioButtonList5.Visible = false; RadioButtonList1.ClearSelection(); RadioButtonList2.ClearSelection(); RadioButtonList3.ClearSelection(); RadioButtonList4.ClearSelection(); RadioButtonList5.ClearSelection(); } }
protected void Button1_Click(object sender, EventArgs e) { string s = @"Data Source=localhost; Database=audit_form; User ID=root; Password='******'"; if (faculty_name_text.Text == "" || sub_text.Text == "" /*|| impr_expt_text.Text == "" || add_cmnt_text.Text == ""*/) { Page.ClientScript.RegisterStartupScript(this.GetType(), "scripts", "<script>alert('Please fill all compulsory fields');</script>"); } else { // try //{ if (fac_count <= fac_name.Count) { Response.Write(fac_count); double sum = (Convert.ToDouble(RadioButtonList1.SelectedValue) + Convert.ToDouble(RadioButtonList2.SelectedValue) + Convert.ToDouble(RadioButtonList3.SelectedValue) + Convert.ToDouble(RadioButtonList4.SelectedValue) + Convert.ToDouble(RadioButtonList5.SelectedValue) + Convert.ToDouble(RadioButtonList6.SelectedValue) + Convert.ToDouble(RadioButtonList7.SelectedValue) + Convert.ToDouble(RadioButtonList8.SelectedValue) + Convert.ToDouble(RadioButtonList9.SelectedValue)); double avg = sum / 9.0; String insert1 = "insert into fac_performance(fac_name,q1,q2,q3,q4,q5,q6,q7,q8,q9,c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,Average) values('" + faculty_name_text.Text + "','" + RadioButtonList1.SelectedItem.Value + "','" + RadioButtonList2.SelectedItem.Value + "','" + RadioButtonList3.SelectedItem.Value + "','" + RadioButtonList4.SelectedItem.Value + "','" + RadioButtonList5.SelectedItem.Value + "','" + RadioButtonList6.SelectedItem.Value + "','" + RadioButtonList7.SelectedItem.Value + "','" + RadioButtonList8.SelectedItem.Value + "','" + RadioButtonList9.SelectedItem.Value + "','" + TextBox5.Text + "','" + TextBox6.Text + "','" + TextBox7.Text + "','" + TextBox8.Text + "','" + TextBox9.Text + "','" + TextBox10.Text + "','" + TextBox11.Text + "','" + TextBox12.Text + "','" + TextBox13.Text + "','" + impr_expt_text.Text + "','" + add_cmnt_text.Text + "','" + avg + "')"; MySqlCommand cmd2 = new MySqlCommand(insert1, con); cmd2.ExecuteNonQuery(); /* Sets every radiobuttonlist to null */ { RadioButtonList1.ClearSelection(); RadioButtonList2.ClearSelection(); RadioButtonList3.ClearSelection(); RadioButtonList4.ClearSelection(); RadioButtonList5.ClearSelection(); RadioButtonList6.ClearSelection(); RadioButtonList7.ClearSelection(); RadioButtonList8.ClearSelection(); RadioButtonList9.ClearSelection(); TextBox5.Text = String.Empty; TextBox6.Text = String.Empty; TextBox7.Text = String.Empty; TextBox8.Text = String.Empty; TextBox9.Text = String.Empty; TextBox10.Text = String.Empty; TextBox11.Text = String.Empty; TextBox12.Text = String.Empty; TextBox13.Text = String.Empty; impr_expt_text.Text = String.Empty; add_cmnt_text.Text = String.Empty; } if (fac_count == fac_name.Count) { Response.Redirect("Student_Login_Page.aspx"); } else { faculty_name_text.Text = fac_name[fac_count]; sub_text.Text = sub[fac_count]; fac_count += 1; } } else { /*Button1.Text = "submit"; Session.Clear(); Session.Abandon(); */ /*Response.ExpiresAbsolute = DateTime.Now; * Response.Expires = 0; * Response.CacheControl = "no-cache"; */ Response.Redirect("Student_Login_Page.aspx"); } //} /* catch (Exception ex) * { * Console.WriteLine(ex); * } * finally * { con.Close(); }*/ } }