protected void txtSubLocCode_TextChanged(object sender, EventArgs e) { string lcode = txtSubLocCode.Text; if (lcode == "") { txtSubCodeDesc.Text = ""; txtSubCodeDesc.Enabled = false; btnSaveSubLoc.Enabled = false; btnDeleteSubLoc.Enabled = false; FormLayoutDetail.Visible = false; btnSelectTransCode.Visible = false; GridViewTransLocs.Visible = false; return; } if (myFunc.isSubLocCodeExist(txtLocCode.Text, lcode)) { txtSubCodeDesc.Enabled = true; txtSubCodeDesc.Text = myFunc.GetSubLocDesc(txtLocCode.Text, lcode); btnSaveSubLoc.Enabled = true; btnDeleteSubLoc.Enabled = true; txtTransLocCode.Text = txtLocCode.Text.ToUpper(); txtTransSubLocCode.Text = txtSubLocCode.Text.ToUpper(); FormLayoutDetail.Visible = true; GridViewTransLocs.Visible = true; SqlDataSourceTransLocations.SelectCommand = "select * from PartsTransLocation where PartsLocCode='" + txtLocCode.Text + "' and PartsSubLocCode='" + txtSubLocCode.Text + "'"; SqlDataSourceTransLocations.Select(DataSourceSelectArguments.Empty); GridViewTransLocs.Visible = true; btnSelectTransCode.Visible = true; GridViewTransLocs.DataBind(); btnCreateLocation.Enabled = true; } else { txtSubCodeDesc.Enabled = true; txtSubCodeDesc.Text = ""; txtSubCodeDesc.Focus(); btnSaveSubLoc.Enabled = true; btnDeleteSubLoc.Enabled = false; FormLayoutDetail.Visible = false; GridViewTransLocs.Visible = false; btnSelectTransCode.Visible = false; } }