//btnOK_Click
		//btnCancel_Click
		private void SetContextDataAndReturn(bool updateValues)
		{
			Business.DependencyTarget termDependencyTarget = _termDependency.Target;
			//If the user clicks Cancel and the EditMode == Add, then remove the newly added term from the collection
			if (_editMode == EditMode.Add && !updateValues)
			{
				_template.RemoveTermDependency(_termDependency.ID);
				_termDependency = null;
			}

			List<string> errors = ValidateForm();
			if (updateValues && (errors != null) && (errors.Count > 0))
			{
				System.IO.StringWriter sw = new System.IO.StringWriter();
				sw.Write("Unable to save the term dependency due to the following errors:\\n\\n");
				foreach (string error in errors)
				{
					sw.Write(error);
					sw.Write("\\n");
				}
				sw.Write("\\nPlease correct the error(s) and try again.");
				RegisterAlert(sw.ToString());
			}
			else
			{
				if (updateValues)
					UpdateValues();
				Context.Items[Common.Names._CNTXT_TermDependency] = _termDependency;
				Context.Items[Common.Names._CNTXT_Template] = _template;
				//IsChanged related change
				if (IsChangedInitial)
					Context.Items[Common.Names._CNTXT_IsChanged] = true;
				else if (IsChanged)
					Context.Items[Common.Names._CNTXT_IsChanged] = updateValues;
				else
					Context.Items[Common.Names._CNTXT_IsChanged] = false;

				switch (termDependencyTarget)
				{
					case Business.DependencyTarget.Workflow:
						Server.Transfer("TemplateWorkflows.aspx");
						break;
					case Business.DependencyTarget.Term:
						Server.Transfer("TemplateTermDependencies.aspx");
						break;
				}
			}
		}
		protected override void LoadViewState(object savedState)
		{
			base.LoadViewState(savedState);
			_termDependency = (Business.TermDependency)ViewState[_KH_VS_TERMDEPENDENCY];
			//_termDependencyIndex = (int)ViewState[_KH_VS_TERMDEPENDENCYINDEX];
			_editMode = (EditMode)ViewState[_KH_VS_EDITMODE];
		}
		//OnLoad, NotPostBack
		private void GetContextData()
		{
			_template = (Business.Template)Context.Items[Common.Names._CNTXT_Template];
			_editMode = (EditMode)Context.Items[Common.Names._CNTXT_EditMode];
			_termDependency = (Business.TermDependency)Context.Items[Common.Names._CNTXT_TermDependency];
			if (_termDependency == null)
				throw new Exception("Error retrieving Term Dependency.");
		}