protected void tbxMhIdAdd_TextChanged(object sender, EventArgs e) { try { mWizard2 master = (mWizard2)this.Master; ScriptManager scriptManager = (ScriptManager)master.FindControl("ScriptManager1"); if (scriptManager.IsInAsyncPostBack) { // cast DropDownList control which has initiated the call: TextBox tbxMhIdAdd = (TextBox)sender; int companyId = Int32.Parse(hdfCompanyId.Value); string mhId = tbxMhIdAdd.Text; Int64? countryId = null; if (hdfCountryId.Value != "0") countryId = Int64.Parse(hdfCountryId.Value); Int64? provinceId = null; if (hdfProvinceId.Value != "0") provinceId = Int64.Parse(hdfProvinceId.Value); Int64? countyId = null; if (hdfCountyId.Value != "0") countyId = Int64.Parse(hdfCountyId.Value); Int64? cityId = null; if (hdfCityId.Value != "0") cityId = Int64.Parse(hdfCityId.Value); AssetSewerMHGateway assetSewerMHGateway = new AssetSewerMHGateway(); assetSewerMHGateway.LoadByCountryIdProvinceIdCountyIdCityIdMhId(countryId, provinceId, countyId, cityId, mhId, companyId, "", "", ""); //TODO MH if (assetSewerMHGateway.Table.Rows.Count > 0) { ((TextBox)grdAddManholeNew.FooterRow.FindControl("tbxStreetAdd")).Text = assetSewerMHGateway.GetAddress(mhId); ((TextBox)grdAddManholeNew.FooterRow.FindControl("tbxLatitudeAdd")).Text = assetSewerMHGateway.GetLatitude(mhId); ((TextBox)grdAddManholeNew.FooterRow.FindControl("tbxLongitudeAdd")).Text = assetSewerMHGateway.GetLongitude(mhId); } } } catch { } }