示例#1
0
        public static string GenerateKnockoutHrefExpression(string routeName, HtmlGenericControl control, RenderContext context)
        {
            var link = GenerateRouteLinkCore(routeName, control, context);

            if ((bool)control.GetValue(Internal.IsSpaPageProperty))
            {
                return string.Format("'#!/' + {0}", link);
            }
            else
            {
                return string.Format("'{0}' + {1}", context.RequestContext.TranslateVirtualPath("~/"), link);
            }
        }
示例#2
0
        public static string EvaluateRouteUrl(string routeName, HtmlGenericControl control, RenderContext context)
        {
            var coreUrl = GenerateRouteUrlCore(routeName, control, context);

            if ((bool)control.GetValue(Internal.IsSpaPageProperty))
            {
                return "#!/" + coreUrl;
            }
            else
            {
                return context.RequestContext.TranslateVirtualPath("~/" + coreUrl);
            }
        }