/// <summary>
        /// Creates a HtmlButtonTag from a HTMLInputElementClass.
        /// </summary>
        /// <param name="buttonElement"> The HTMLInputElementClass to convert.</param>
        /// <returns> A HtmlButtonTag.</returns>
        private HtmlButtonTag CreateHtmlButtonTag(HTMLInputButtonElementClass buttonElement)
        {
            HtmlButtonTag tag = new HtmlButtonTag();

            tag.Class = buttonElement.className;
            tag.Id = buttonElement.id;
            if ( buttonElement.name != null )
            {
                tag.Name = buttonElement.name;
            }
            else
            {
                if ( buttonElement.id != null )
                {
                    tag.Name = buttonElement.id;
                }
                else
                {
                    tag.Name = String.Empty;
                    tag.Id = String.Empty;
                }
            }
            //tag.OnClick = currentNode.GetAttribute("onclick",currentNode.NamespaceURI);
            //tag.Style = currentNode.GetAttribute("style",currentNode.NamespaceURI);
            tag.Title = buttonElement.title;

            switch ( buttonElement.type )
            {
                case "button":
                    tag.Type=HtmlButtonType.Button;
                    break;
                case "reset":
                    tag.Type=HtmlButtonType.Reset;
                    break;
                case "submit":
                    tag.Type=HtmlButtonType.Submit;
                    break;
            }

            tag.Value = buttonElement.value;

            return tag;
        }
        private void AddButtonNode(FormEditorNode node, HtmlButtonTag button)
        {
            string label;
            label = "<button ";
            label +=" name="+ button.Name;
            label +=" value="+ button.Value;
            label +="/>";

            //tree.AddButton(node,button);
        }
        /// <summary>
        /// Adds a button node.
        /// </summary>
        /// <param name="text">The node text.</param>
        /// <param name="button"> The HtmlButtonTag.</param>
        public void AddButton(string text,HtmlButtonTag button)
        {
            FormEditorNode node = new FormEditorNode();
            node.Text=text;
            node.BaseHtmlTag = button;

            TextBox[] textboxes;
            textboxes = GetTextBoxArray(1);
            textboxes = GetTextBoxArray(1);
            textboxes[0].Name = "txtValue";
            textboxes[0].Text = button.Value;
            node.AddControl("Value:",textboxes[0]);
        }
        /// <summary>
        /// Adds the button post data string.
        /// </summary>
        /// <param name="tag"> The button tag.</param>
        /// <param name="list"> The arraylist to append tag.</param>
        public void AddButtonPostData(HtmlButtonTag buttonTag, ArrayList list)
        {
            // no Name, so we cant send it to server
            if ( !buttonTag.Name.StartsWith("ms__id") )
            {
                string s = EncodeDecode.UrlEncode(buttonTag.Name) + "="
                    + EncodeDecode.UrlEncode(buttonTag.Value);

                //name and value
                list.Add(s);
            }
        }
        /// <summary>
        /// Adds the button post data string.
        /// </summary>
        /// <param name="buttonTag"> The button tag.</param>
        /// <param name="list"> The arraylist to append tag.</param>
        /// <param name="addEndLine"> The add end line boolean value.</param>
        public void AddButtonPostData(HtmlButtonTag buttonTag, ArrayList list, bool addEndLine)
        {
            if ( addEndLine )
            {
                buttonTag.Value = AddEndLine(buttonTag.Value);
            }

            AddButtonPostData(buttonTag, list);
        }
        /// <summary>
        /// Creates a button tag.
        /// </summary>
        /// <param name="currentNode"> The XPathNavigator node.</param>
        /// <returns> A HtmlButtonTag.</returns>
        private HtmlButtonTag FillButtonTag(XPathNavigator currentNode)
        {
            HtmlButtonTag tag = new HtmlButtonTag();

            tag.Class=currentNode.GetAttribute("class",currentNode.NamespaceURI);
            tag.Id=currentNode.GetAttribute("id",currentNode.NamespaceURI);
            tag.Name=currentNode.GetAttribute("name",currentNode.NamespaceURI);
            tag.OnClick=currentNode.GetAttribute("onclick",currentNode.NamespaceURI);
            tag.Style=currentNode.GetAttribute("style",currentNode.NamespaceURI);
            tag.Title=currentNode.GetAttribute("title",currentNode.NamespaceURI);

            if ( tag.OnClick.Length == 0 )
            {
                tag.OnClick = currentNode.GetAttribute("onClick",currentNode.NamespaceURI);
            }

            switch (currentNode.GetAttribute("type",currentNode.NamespaceURI))
            {
                case "button":
                    tag.Type=HtmlButtonType.Button;
                    break;
                case "reset":
                    tag.Type=HtmlButtonType.Reset;
                    break;
                case "submit":
                    tag.Type=HtmlButtonType.Submit;
                    break;
            }
            tag.Value = currentNode.GetAttribute("value",currentNode.NamespaceURI);

            return tag;
        }