protected void txtSearch_TextChanged(object sender, EventArgs e) { try { DropDownList ddlPropertyName = (DropDownList)Master.FindControl("ddlProperty"); string PropertyName = ddlPropertyName.SelectedItem.Text; string PropertyVale = ddlPropertyName.SelectedItem.Value; gvLateCheckin.DataSource = tenants.GetLateCheckinRecordBySearch(PropertyVale, txtSearch.Text); gvLateCheckin.DataBind(); } catch (Exception ex) { string text = ex.Message.ToString(); ScriptManager.RegisterStartupScript(this, typeof(Page), "Warning", "<script>showpoperror('" + text + "')</script>", false); } }