public static string EvaluateRouteUrl(string routeName, HtmlGenericControl control, DotvvmProperty urlSuffixProperty, IDotvvmRequestContext context) { var coreUrl = GenerateRouteUrlCore(routeName, control, context) + (control.GetValue(urlSuffixProperty) as string ?? ""); if ((bool)control.GetValue(Internal.IsSpaPageProperty)) { return("#!/" + coreUrl); } else { return(context.TranslateVirtualPath(coreUrl)); } }
public static string EvaluateRouteUrl(string routeName, HtmlGenericControl control, DotvvmProperty urlSuffixProperty, IDotvvmRequestContext context) { var coreUrl = GenerateRouteUrlCore(routeName, control, context) + (control.GetValue(urlSuffixProperty) as string ?? ""); if ((bool)control.GetValue(Internal.IsSpaPageProperty)) { return "#!/" + coreUrl; } else { return context.TranslateVirtualPath(coreUrl); } }
private static string GetUrlSuffixExpression(HtmlGenericControl control, DotvvmProperty urlSuffixProperty) { var urlSuffixBinding = control.GetValueBinding(urlSuffixProperty); if (urlSuffixBinding != null) { return("(" + urlSuffixBinding.GetKnockoutBindingExpression(control) + ")"); } else { return(JsonConvert.SerializeObject(control.GetValue(urlSuffixProperty) as string ?? "")); } }
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); } }
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); } }
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)); } }
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)); } }
public static string GenerateKnockoutHrefExpression(string routeName, HtmlGenericControl control, DotvvmProperty urlSuffixProperty, IDotvvmRequestContext context) { var link = GenerateRouteLinkCore(routeName, control, context); var urlSuffix = GetUrlSuffixExpression(control, urlSuffixProperty); if ((bool)control.GetValue(Internal.IsSpaPageProperty)) { return $"'#!/' + {link} + {urlSuffix}"; } else { return $"'{context.TranslateVirtualPath("~/")}' + {link} + {urlSuffix}"; } }
public static string GenerateKnockoutHrefExpression(string routeName, HtmlGenericControl control, DotvvmProperty urlSuffixProperty, IDotvvmRequestContext context) { var link = GenerateRouteLinkCore(routeName, control, context); var urlSuffix = GetUrlSuffixExpression(control, urlSuffixProperty); if ((bool)control.GetValue(Internal.IsSpaPageProperty)) { return($"'#!/' + {link} + {urlSuffix}"); } else { return($"'{context.TranslateVirtualPath("~/")}' + {link} + {urlSuffix}"); } }
private static string GetUrlSuffixExpression(HtmlGenericControl control, DotvvmProperty urlSuffixProperty) { var urlSuffixBinding = control.GetValueBinding(urlSuffixProperty); string urlSuffix; if (urlSuffixBinding != null) { urlSuffix = urlSuffixBinding.GetKnockoutBindingExpression(); } else { urlSuffix = JsonConvert.SerializeObject(control.GetValue(urlSuffixProperty) as string ?? ""); } return urlSuffix; }