Search

Overview

The ClientDependency Framework is designed to affiliate any of your views & controls to CSS and JavaScript files without having to worry about if other views or controls have already been registered with them, making developing web components much easier because each component has it's own dependencies registered for it to function. ClientDependency will not only manage the inter-dependencies of scripts and styles between all your views, controls and pages but has the added benefit of managing all of the file compression, combination & minification for you. It will even detect and process script/styles that aren't registered with the framework and other requests such as json that can be minified/compressed. All of this is fully configurable if you need to modify any of the default behavior.

This project includes support for:
  • ASP.Net MVC Framework
  • Make your controls dependent on client files by:
    • Using HtmlHelpers
    • Attributing your controls
    • Using the JSInclude or CSSInclude web controls
    • Dynamically registering them in code
  • Combining, compressing & minifying JavaScript and CSS files
    • Also, compressing & minifying JavaScript and CSS files that are found directly in the markup without being registered with ClientDependency framework (these files are termed 'Rogue' files in this framework)
  • Adding dependencies on external/CDN files
  • OutputCaching of the combined/compressed composite files
  • Persisting the combined/compressed composite files for increased performance when applications restart or when the Cache expires
  • Versioning the files ... great for ensuring your clients' browser cache is cleared!
  • Tagging client files with priorities
  • Tagging client files with path names so you don't have to worry about moving files around in your project, worrying about absolute vs relative paths, or running your application in a virtual folder... great for theming!
  • Detecting 'Rogue' script and styles in your pages to have them magically compressed and output
  • Provider Model so you can choose how you would like your JS and CSS files rendered
  • Provider Model so you can choose how you would like your JS and CSS files combined, compressed & minified

Quick Examples

Registration in markup (MVC):

<% Html
         .RequiresCss("ColorScheme.css", "Styles") %>
         .RequiresJs("/Js/jquery-1.3.2.min.js"); %>

Registration in markup (Web Forms):

<CD:CssInclude ID="CssInclude1" runat="server" FilePath="~/CSS/Content.css" /> 

Registration via attributes (Web Forms):

[ClientDependency(ClientDependencyType.Css, "~/Css/CustomControl.css")] 

Documentation

See Documentation tab
Last edited Aug 25 2011 at 4:02 AM by Shandem, version 38
Updating...
© 2006-2012 Microsoft | Get Help | Privacy Statement | Terms of Use | Code of Conduct | Advertise With Us | Version 2012.1.11.18365