protected void Page_PreRender(object sender, EventArgs e)
        {
            if (CurrentlySelectedFieldId != Guid.Empty)
            {
                var defaultFunction = StandardFunctions.GetDefaultFunctionByType(this.CurrentlySelectedType);

                btnDefaultValueFunctionMarkup.Attributes["label"] = GetString(btnDefaultValueFunctionMarkup.Value.IsNullOrEmpty() ? "DefaultValueSpecify" : "DefaultValueEdit");
                btnDefaultValueFunctionMarkup.Attributes["url"]   =
                    "${root}/content/dialogs/functions/editFunctionCall.aspx?type=" + this.CurrentlySelectedType.FullName +
                    "&dialoglabel=" + HttpUtility.UrlEncodeUnicode(GetString("DefaultValueDialogLabel")) + "&multimode=false&functionmarkup=";


                btnTestValueFunctionMarkup.Attributes["label"] = GetString(btnTestValueFunctionMarkup.Value.IsNullOrEmpty() ? "TestValueSpecify" : "TestValueEdit");
                btnTestValueFunctionMarkup.Attributes["url"]   =
                    "${root}/content/dialogs/functions/editFunctionCall.aspx?type=" + this.CurrentlySelectedType.FullName +
                    "&dialoglabel=" + HttpUtility.UrlEncodeUnicode(GetString("TestValueDialogLabel")) + "&multimode=false&functionmarkup=";

                btnWidgetFunctionMarkup.Attributes["label"] = CurrentlySelectedWidgetText;
                btnWidgetFunctionMarkup.Attributes["url"]   =
                    "${root}/content/dialogs/functions/editFunctionCall.aspx?functiontype=widget&type=" + this.CurrentlySelectedWidgetReturnType.FullName +
                    "&dialoglabel=" + HttpUtility.UrlEncodeUnicode(GetString("WidgetDialogLabel")) + "&multimode=false&functionmarkup=";

                if (defaultFunction != null)
                {
                    string defaultValue = new FunctionRuntimeTreeNode(defaultFunction).Serialize().ToString();

                    btnDefaultValueFunctionMarkup.DefaultValue = defaultValue;
                    btnTestValueFunctionMarkup.DefaultValue    = defaultValue;
                }
            }

            btnDelete.Attributes["isdisabled"] = CurrentlySelectedFieldId == Guid.Empty ? "true" : "false";

            if (nameChanged)
            {
                UpdateFieldsPanel();
            }

            _state.Parameters = this.CurrentFields.ToList();
            SessionStateManager.GetProvider(SessionStateProviderName).SetState(StateId, _state, DateTime.Now.AddDays(7.0));
        }