public static string ResolvePath(this IClientDependencyPath path, HttpContextBase http)
 {
     if (string.IsNullOrEmpty(path.Path))
     {
         throw new ArgumentException("The Path specified is null", "Path");
     }
     if (path.Path.StartsWith("~/"))
     {
         return(http.ResolveUrl(path.Path));
     }
     return(path.Path);
 }
Beispiel #2
0
 /// <summary>
 /// Dynamically registers a path alias
 /// </summary>
 /// <param name="html"></param>
 /// <param name="path"></param>
 public static void RegisterPathAlias(this HtmlHelper html, IClientDependencyPath path)
 {
     html.ViewContext.GetLoader().AddPath(path);
 }
 /// <summary>
 /// Dynamically registers a path alias
 /// </summary>
 /// <param name="html"></param>
 /// <param name="path"></param>
 public static void RegisterPathAlias(this HtmlHelper html, IClientDependencyPath path)
 {
     html.ViewContext.GetLoader().AddPath(path);
 }
Beispiel #4
0
 /// <summary>
 /// Adds a path to the current loader
 /// </summary>
 /// <param name="path"></param>
 /// <returns>Returns the current loader instance so you can chain calls together</returns>
 public BaseLoader AddPath(IClientDependencyPath path)
 {
     Paths.Add(path);
     return this;
 }		
Beispiel #5
0
 /// <summary>
 /// Adds a path to the current loader
 /// </summary>
 /// <param name="path"></param>
 public ClientDependencyLoader AddPath(IClientDependencyPath path)
 {
     _base.AddPath(path);
     return(this);
 }
Beispiel #6
0
 public static string RenderJsHere(this HtmlHelper html, IClientDependencyPath path)
 {
     return html.ViewContext.GetLoader().RenderPlaceholder(
         ClientDependencyType.Javascript, new List<IClientDependencyPath>() { path });
 }
 /// <summary>
 /// Adds a path to the current loader
 /// </summary>
 /// <param name="path"></param>
 /// <returns>Returns the current loader instance so you can chain calls together</returns>
 public BaseLoader AddPath(IClientDependencyPath path)
 {
     Paths.Add(path);
     return(this);
 }