コード例 #1
0
        /// <summary>
        ///  Returns the item content item defautl Url usign given content location
        /// </summary>
        /// <param name="helper">The Html helper</param>
        /// <param name="location">The location of the item</param>
        /// <param name="alternativeUrl">Alternative Url of the dataItem. It will be used if the location is null</param>
        /// <returns>The default Url of the item</returns>
        private static string GetItemDefaultUrl(this HtmlHelper helper, IContentItemLocation location, string alternativeUrl = null)
        {
            var result = string.Empty;

            if (location != null)
            {
                result = location.ItemAbsoluteUrl;
            }
            else if (!string.IsNullOrEmpty(alternativeUrl))
            {
                result = UrlHtmlHelperExtensions.GetRelativeUrl(helper, alternativeUrl);
            }

            return(result);
        }
コード例 #2
0
        /// <summary>
        ///  Returns the item content item defautl Url usign given content location
        /// </summary>
        /// <param name="helper">The Html helper</param>
        /// <param name="location">The location of the item</param>
        /// <param name="alternativeUrl">Alternative Url of the dataItem. It will be used if the location is null</param>
        /// <returns>The default Url of the item</returns>
        private static string GetItemDefaultUrl(this HtmlHelper helper, IContentItemLocation location, string alternativeUrl = null)
        {
            var result = string.Empty;

            if (location != null)
            {
                result = location.ItemAbsoluteUrl;
            }
            else if (!string.IsNullOrEmpty(alternativeUrl))
            {
                result = UrlHtmlHelperExtensions.GetRelativeUrl(helper, alternativeUrl);
            }

            return result;
        }