protected void ButtonSearchFlats_Click(object sender, EventArgs e) { try { if (TextBoxMinDeposit.Text == "") { TextBoxMinDeposit.Text = "0"; } if (TextBoxMaxDeposit.Text == "") { TextBoxMaxDeposit.Text = "50000"; } if (TextBoxMinRent.Text == "") { TextBoxMinRent.Text = "0"; } if (TextBoxMaxRent.Text == "") { TextBoxMaxRent.Text = "10000"; } DataSet ds = client.SearchFlats(TextBoxCity.Text.Trim(), Convert.ToInt32(TextBoxMinRent.Text), Convert.ToInt32(TextBoxMaxRent.Text), Convert.ToInt32(TextBoxMinDeposit.Text), Convert.ToInt32(TextBoxMaxDeposit.Text)); DataTable dt = ds.Tables[0]; GridViewAllFlats.DataSource = dt; GridViewAllFlats.DataBind(); LabelFlats.Visible = false; GridViewAllFlats.Visible = true; Tab1.Visible = true; Tab2.Visible = true; Tab3.Visible = true; ButtonVisibilityAll(); } catch { LabelFlats.Visible = true; GridViewAllFlats.Visible = false; Tab1.Visible = false; Tab2.Visible = false; Tab3.Visible = false; } }