protected void BtnSearch_Click(object sender, EventArgs e) { TxtRmark.Enabled = true; lblSms.Text = ""; int c = 0; if (DDLExamYear.SelectedIndex != 0) { //c = 1; if (DDLExamSession.SelectedIndex != 0) { if (txtRollNo.Text != "" || TxtStuName.Text != "") { c = 1; if (c == 1 && DDLApply.SelectedIndex != 0) { SearchDetail(); } else { lblSms.Text = "Please Select Applied For."; DDLApply.Focus(); } } else { lblSms.Text = "Please Enter Roll No. Or Student Name."; txtRollNo.Focus(); } } else { lblSms.Text = "Please Select Exam Session."; DDLExamSession.Focus(); } foreach (GridViewRow rw in GridStudentDetail.Rows) { CheckBox chkBx = (CheckBox)rw.FindControl("CheckBox1"); if (GridStudentDetail.Rows.Count == 1) { chkBx.Checked = true; } else { chkBx.Checked = false; } } } else { lblSms.Text = "Please Select Exam Year."; DDLExamYear.Focus(); } }
private void BindForApply() // Exam Purpose For Apply { HttpClient HClient = new HttpClient(); HClient.BaseAddress = new Uri(DataAcces.Url); HClient.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); objplstudentDetail = new PlStudentDetail(); var uri = "api/StudentDetail/GetApply/?ind=" + "15"; var response = HClient.GetAsync(uri).Result; if (response.IsSuccessStatusCode) { var getdata = response.Content.ReadAsAsync <IEnumerable <PlStudentDetail> >().Result; if (getdata.Count() > 0) { DDLApply.DataSource = getdata; DDLApply.DataValueField = "ItemID"; DDLApply.DataTextField = "DocumentType"; DDLApply.DataBind(); } getdata = null; } response = null; uri = null; }