コード例 #1
0
ファイル: RouteLinkHelpers.cs プロジェクト: vijayaraju/dotvvm
        public static string EvaluateRouteUrl(string routeName, RouteLink control, IDotvvmRequestContext context)
        {
            var urlSuffix = GenerateUrlSuffixCore(control.GetValue(RouteLink.UrlSuffixProperty) as string, control);
            var coreUrl   = GenerateRouteUrlCore(routeName, control, context) + urlSuffix;

            if ((bool)control.GetValue(Internal.IsSpaPageProperty) ! && !(bool)control.GetValue(Internal.UseHistoryApiSpaNavigationProperty) !)
            {
                return("#!/" + (coreUrl.StartsWith("~/", StringComparison.Ordinal) ? coreUrl.Substring(2) : coreUrl));
            }
コード例 #2
0
ファイル: RouteLinkHelpers.cs プロジェクト: kowgli/dotvvm
        public static string EvaluateRouteUrl(string routeName, RouteLink control, IDotvvmRequestContext context)
        {
            var urlSuffix = GenerateUrlSuffixCore(control.GetValue(RouteLink.UrlSuffixProperty) as string, control);
            var coreUrl   = GenerateRouteUrlCore(routeName, control, context) + urlSuffix;

            if ((bool)control.GetValue(Internal.IsSpaPageProperty))
            {
                return("#!/" + (coreUrl.StartsWith("~/") ? coreUrl.Substring(2) : coreUrl));
            }
            else
            {
                return(context.TranslateVirtualPath(coreUrl));
            }
        }
コード例 #3
0
        public static string GenerateKnockoutHrefExpression(string routeName, RouteLink control, IDotvvmRequestContext context)
        {
            var link = GenerateRouteLinkCore(routeName, control, context);

            var urlSuffix = GetUrlSuffixExpression(control);

            if ((bool)control.GetValue(Internal.IsSpaPageProperty) && !context.Configuration.UseHistoryApiSpaNavigation)
            {
                return($"'#!/' + {link}{(urlSuffix == null ? "" : " + " + urlSuffix)}");
            }
            else
            {
                return($"'{context.TranslateVirtualPath("~/")}' + {link}{(urlSuffix == null ? "" : " + " + urlSuffix)}");
            }
        }