コード例 #1
0
ファイル: LayoutExtensions.cs プロジェクト: sounj142/aaabbb
 /// <summary>
 /// Generate all canonical URL parts
 /// </summary>
 /// <param name="html">HTML helper</param>
 /// <param name="pageHeadBuilder"></param>
 /// <param name="part">Canonical URL part</param>
 /// <returns>Generated string</returns>
 public static MvcHtmlString NopCanonicalUrls(this HtmlHelper html,
     IPageHeadBuilder pageHeadBuilder = null, string part = null)
 {
     if (pageHeadBuilder == null)
         pageHeadBuilder = EngineContext.Current.Resolve<IPageHeadBuilder>();
     pageHeadBuilder.AppendCanonicalUrlParts(part);
     string content = pageHeadBuilder.GenerateCanonicalUrls();
     return MvcHtmlString.Create(content);
 }
コード例 #2
0
        /// <summary>
        /// Append canonical URL element to the <![CDATA[<head>]]>
        /// </summary>
        /// <param name="html">HTML helper</param>
        /// <param name="part">Canonical URL part</param>
        public static void AppendCanonicalUrlParts(this IHtmlHelper html, string part)
        {
            IPageHeadBuilder pageHeadBuilder = ServiceProviderFactory.ServiceProvider.GetService <IPageHeadBuilder>();

            pageHeadBuilder.AppendCanonicalUrlParts(part);
        }
コード例 #3
0
ファイル: LayoutExtensions.cs プロジェクト: sounj142/aaabbb
 /// <summary>
 /// Append canonical URL element to the <![CDATA[<head>]]>
 /// </summary>
 /// <param name="html">HTML helper</param>
 /// <param name="part">Canonical URL part</param>
 /// <param name="pageHeadBuilder"></param>
 public static void AppendCanonicalUrlParts(this HtmlHelper html, string part,
     IPageHeadBuilder pageHeadBuilder = null)
 {
     if (pageHeadBuilder == null)
         pageHeadBuilder = EngineContext.Current.Resolve<IPageHeadBuilder>();
     pageHeadBuilder.AppendCanonicalUrlParts(part);
 }