Bundle virtual-paths should not be duplicated, otherwise the dupe will overwrite the contents of the previous entry. To add more than one file to a bundle, wrap them in the params in the Include method.
For example, in BundleConfig.cs RegisterBundles, this:
Needs to be this:
Also, the bundle virtual path depth should be the same as the depth of the file you are referring to (4 in the example below). If you don’t do this, relative paths in your less/css will fail.
I wrote this library so I don’t have to keep track if I should use HttpRuntime.Cache, AppDomain.CurrentDomain.SetData, HttpContext.Current.Session, or a Dictionary…now I just use GlobalCache or UserCache. It also makes unit testing a webapp a snap, because if you use IGlobalCache/IUserCache in your code, you just inject the Windows-based cache in your unit test setup.
You can download the solution with dlls here: Universal Caching solution
If you upgrade from MVC 1 to 2 or higher and your controller factory (such as StructureMapControllerFactory) throws a “no suitable method found to override” error for your GetControllerInstance method, be sure you have a reference to System.Web.Routing:
And be sure you add the RequestContext parameter to the GetControllerInstance method call like this:
protected override IController GetControllerInstance(RequestContext requestContext, Type controllerType)
Magic strings are just nuclear-powered bug magnets. They attract fat-fingering mistakes while coding and practically guarantee bugs will be introduced while refactoring. If you’re like me, you’ll hate the magic strings required in the Html.DropDownListFor as much as I do. Now there’s an easy way to get rid of them once and for all…
View full article »
Do you have a post action that accepts a parameter (and what post action doesn’t?), but you also have a get action that accepts a parameter and you are seeing that submits are going back to the get action and other strange behavior? Here’s how you fix that:
View full article »