Пример #1
0
 /// <summary>
 /// Generate all title parts
 /// </summary>
 /// <param name="html">HTML helper</param>
 /// <param name="addDefaultTitle">A value indicating whether to insert a default title</param>
 /// <param name="part">Title part - chuỗi bạn muốn nối thêm vào cuối title được phát sinh nếu có</param>
 /// <param name="pageHeadBuilder"></param>
 /// <returns>Generated string</returns>
 public static MvcHtmlString NopTitle(this HtmlHelper html, bool addDefaultTitle, 
     IPageHeadBuilder pageHeadBuilder = null, string part = null)
 {
     if (pageHeadBuilder == null)
         pageHeadBuilder = EngineContext.Current.Resolve<IPageHeadBuilder>();
     pageHeadBuilder.AppendTitleParts(part);
     string content = html.Encode(pageHeadBuilder.GenerateTitle(addDefaultTitle));
     return MvcHtmlString.Create(content);
 }
Пример #2
0
        /// <summary>
        /// Append title element to the <![CDATA[<head>]]>
        /// </summary>
        /// <param name="html">HTML helper</param>
        /// <param name="part">Title part</param>
        public static void AppendTitleParts(this IHtmlHelper html, string part)
        {
            IPageHeadBuilder pageHeadBuilder = ServiceProviderFactory.ServiceProvider.GetService <IPageHeadBuilder>();

            pageHeadBuilder.AppendTitleParts(part);
        }
Пример #3
0
 /// <summary>
 /// Append title element to the <![CDATA[<head>]]>
 /// </summary>
 /// <param name="html">HTML helper</param>
 /// <param name="part">Title part</param>
 /// <param name="pageHeadBuilder"></param>
 public static void AppendTitleParts(this HtmlHelper html, string part, IPageHeadBuilder pageHeadBuilder = null)
 {
     if (pageHeadBuilder == null)
         pageHeadBuilder = EngineContext.Current.Resolve<IPageHeadBuilder>();
     pageHeadBuilder.AppendTitleParts(part);
 }