protected void btnSubmit2_Click(object sender, EventArgs e) { HttpResponse.RemoveOutputCacheItem("/StateProvinceList.aspx"); string strCityText2 = txtCityText2.Text.Replace(Environment.NewLine, "<br />"); DataTable dt = VADBCommander.CityTextByStateInd(stateprovinceid.ToString()); try { if (dt.Rows.Count > 0) { VADBCommander.CityText2ByStateEdit(stateprovinceid.ToString(), strCityText2); } else { VADBCommander.CityText2ByStateAdd(stateprovinceid.ToString(), strCityText2); } lblInfo2.Text = "Data saved."; DataTable dt4 = VADBCommander.CityTextByStateInd(stateprovinceid.ToString()); if (dt4.Rows.Count > 0) { if (dt4.Rows[0]["cityText"] != null) { lblcityInfo.Text = dt4.Rows[0]["cityText"].ToString(); txtCityText.Text = dt4.Rows[0]["cityText"].ToString().Replace("<br />-ipx-", Environment.NewLine); } if (dt4.Rows[0]["cityText2"] != null) { lblInfo2.Text = dt4.Rows[0]["cityText2"].ToString(); if (string.IsNullOrEmpty(dt4.Rows[0]["cityText2"].ToString()) || dt4.Rows[0]["cityText2"].ToString() == "") { OrangeTitle.Visible = false; } txtCityText2.Text = dt4.Rows[0]["cityText2"].ToString().Replace("<br />", Environment.NewLine); } else { OrangeTitle.Visible = false; } } } catch (Exception ex) { lblInfo2.Text = ex.Message; } lblInfo2.ForeColor = System.Drawing.Color.Red; }