예제 #1
0
        /// <summary>
        /// 新增
        /// </summary>
        /// <param name="title"></param>
        /// <param name="htmlAttributes"></param>
        /// <returns></returns>
        public static HtmlElement Create(string title = null, Dictionary<string, string> htmlAttributes = null)
        {
            var ele = new HtmlElement("input")
                .Set("type", "submit")
                .Set("value", title ?? "确认新增")
                .Set("class", "button green");

            if (htmlAttributes != null)
                foreach (var htmlAttribute in htmlAttributes)
                {
                    ele.Set(htmlAttribute.Key, htmlAttribute.Value);
                }
            return ele;
        }
예제 #2
0
        /// <summary>
        /// 关闭
        /// </summary>
        /// <param name="title"></param>
        /// <param name="htmlAttributes"></param>
        /// <returns></returns>
        public static HtmlElement Close(string title = null, Dictionary<string, string> htmlAttributes = null)
        {
            var ele = new HtmlElement("input")
                .Set("type", "button")
                .Set("value", title ?? "关闭")
                .Set("class", "button white")
                .Set("onclick", "javascript: self.close()");

            if (htmlAttributes != null)
                foreach (var htmlAttribute in htmlAttributes)
                {
                    ele.Set(htmlAttribute.Key, htmlAttribute.Value);
                }
            return ele;
        }