HasHandler() private method

private HasHandler ( ) : bool
return bool
Exemplo n.º 1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="type"></param>
        /// <param name="resourceName"></param>
        /// <param name="config"></param>
        /// <returns></returns>
        public static string GetWebResourceUrl(Type type, string resourceName)
        {
            if (resourceName.StartsWith(ResourceManager.ASSEMBLYSLUG) && ExtNetTransformer.CleanResourceUrl && ResourceHandler.HasHandler())
            {
                string buster = (resourceName.EndsWith(".js") || resourceName.EndsWith(".css")) ? "?v=".ConcatWith(ResourceManager.CacheBuster) : "";

                string url = "~{0}/ext.axd{1}".FormatWith(resourceName.Replace(ResourceManager.ASSEMBLYSLUG, "").Replace('.', '/').ReplaceLastInstanceOf("/", "-"), buster);

                return(ExtNetTransformer.ResolveUrl(url));
            }

            return(HttpUtility.HtmlAttributeEncode(CachedPageInstance.ClientScript.GetWebResourceUrl(type, resourceName)));
        }
Exemplo n.º 2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="type"></param>
        /// <param name="resourceName"></param>
        /// <param name="config"></param>
        /// <returns></returns>
        public static string GetWebResourceUrl(Type type, string resourceName, MVC.MvcResourceManagerConfig config)
        {
            if (resourceName.StartsWith(ResourceManager.ASSEMBLYSLUG) && config.CleanResourceUrl && ResourceHandler.HasHandler())
            {
                string buster = (resourceName.EndsWith(".js") || resourceName.EndsWith(".css")) ? "?v=".ConcatWith(ResourceManager.CacheBuster) : "";

                var url = "~{0}/ext.axd{1}".FormatWith(resourceName.Replace(ResourceManager.ASSEMBLYSLUG, "").Replace('.', '/').ReplaceLastInstanceOf("/", "-"), buster);
                return(System.Web.Mvc.UrlHelper.GenerateContentUrl(url, new HttpContextWrapper(HttpContext.Current)));
            }

            return(HttpUtility.HtmlAttributeEncode(CachedPageInstance.ClientScript.GetWebResourceUrl(type, resourceName)));
        }