How to use query strings in framesets with asp.net mvc 5 routing
The problem – I was working on a project that required frames – and I was trying to pass a querystring value to the frameset, as in /FramePage/?page=/SomePageOffSite.aspx – my first thought was to just pass the url of one of the frames to the frameset page as a string. I made the model for the […]
Five things should should know about the new asp.net identity membership system
I’m trying my first asp.net mvc 5 project, which more or less forces you to use the new asp.net identity framework for membership. It’s in the using Microsoft.AspNet.Identity namespace. While a vast improvement over the original asp.net membership – I do not see any massive benefit over the MVC 4 Simple Membership system. Here are […]
How to track outbound links in the new version of Google Analytics
So the Gods of Google have gone and changed their basic Google Analytics code to something that works slightly better, and now your outbound link tracking code doesn’t work. Here is how you fix that – first make sure you have the most recent (as of July 2013 Google Analytics code, it looks something like […]
How to fix the infamous “Unable to cast object of type ‘System.Int32’ to type ‘System.String’ error in asp.net mvc
The Problem You have created a lovely model in asp.net mvc 4, using Entity Framework and a whole host of attributes. One of the properties of your model looks like this [Required] [Display(Name = “Expiration Month (MM)”)] [StringLength(2,ErrorMessage = “You must enter two digits”, MinimumLength = 1)] [Range(1,12, ErrorMessage = “You must enter a valid […]
How to fix problems with data cacheing in ASP.net MVC 4, SignalR and Entity Framework
The Problem I was using the wonderful SignalR libraries to create a status window (I have a VERY long running process in my new Data Hammer project, it takes about 15 minutes to run) and I need to inform the user on where the process is at any given time. My original code looked like […]
How to configure wildcard routing in asp.net mvc 4
The Problem You are trying to configure Widlcard routing (i.e. something like https://domain.com/SomeUserName/) and find it problematic. The Cause That is largely by design – wildcard routing is resource intensive and rarely needed. The Solution If you want to do it anyway, use the following routes routes.MapRoute(“Default”, “”, new { controller = “Home”, action = […]
How to fix problems with entity framework decimal precision
The Problem You are attempting to change a database column of type decimal from a precision of two decimal place to one decimal place via data annotations, and there does not seem to be a good way to do it. The Cause There isn’t a good way to do it. The Solution However, there is […]
How to fix problems with asp.net mvc 4 javascript bundling
The Problem You are using the new JavaScript bundling and minification features in asp.net mvc 4, and some of your JavaScript files are not being included The Cause The minification process – in it’s strange wisdom, does not include .min files when it bundles. Therefore something like .Include(“~/Scripts/jHtmlArea-0.7.0.min.js”) will not be included, leading to JavaScript errors. The Solution Just use the […]
How to fix the “Unable to launch the visual studio development server because port 9452 is in use” error
The Problem You are coding away, Visual Studio locks up for one of it’s many reasons, and reopen your project and run it again. You then get the “Unable to launch the visual studio development server because port 9452 is in use” error The Cause When Visual Studio crashed, the Web Server did not, so […]
How to fix problems with Ajax Page Caching in asp.net mvc 4
The Problem You’re using the otherwise awesome ASP.net MVC 4 and you can use an ajax function once, via the @Ajax.ActionLink tool, but you try it again, and it does nothing. The Cause For whatever reason the browser thinks it is a cache page and pulls it from the cache – I’m not 100% sure […]