protected void btnStateDelete_Click(object sender, EventArgs e) { OSAEObjectTypeManager.ObjectTypeStateDelete(txtStateName.Text, hdnSelectedObjectName.Text); loadStates(); int selectedRow = Int32.Parse(hdnSelectedStateRow.Text) - 1; if (selectedRow < 0) { hdnSelectedStateRow.Text = ""; } else { hdnSelectedStateRow.Text = selectedRow.ToString(); } }