protected void cmbDocumentNo_SelectedIndexChanged(object sender, EventArgs e) { if (cmbDocumentNo.SelectedIndex == -1) { ScriptManager.RegisterStartupScript(this, GetType(), "showalert", "alert('Please Select Document Number ');", true); } else { dsGetAllDocuments = dbDocumentStatusData.HO_GetDocFromSO(cmbVillage.SelectedValue.ToString(), cmbDocumentNo.SelectedValue.ToString(), "SO1"); if (dsGetAllDocuments.Tables[0].Rows.Count > 0) { grdSiteOfficeDocAll.DataSource = dsGetAllDocuments; grdSiteOfficeDocAll.DataBind(); EnablesControl(); } else { ScriptManager.RegisterStartupScript(this, GetType(), "showalert", "alert('Documents not Generated ');", true); } } }