Unit Testing: Verify a Method Call Ignoring the Parameters
I use Moq extensively when unit testing my applications. One of the nice features of Moq (and any other Mocking framework) is that you can verify which methods were called on a given interface during a...
View ArticleASP.NET MVC: Unauthenticated User Always Redirected to ~/Account/LogOn...
By default new ASP.NET MVC projects redirect any unauthenticated users who request resources that require authentication to the /Account/LogOn action. The log on page is defined in the web.config...
View ArticleASP.NET MVC: Ajax Dialog Form Using jQuery UI
In one of my recent projects I needed to display some information, allow the user to edit it utilizing a dialog window, post the updated information and reload it for the user using Ajax. I needed to...
View ArticleASP.NET MVC: Client Side Validation with an Ajax Loaded Form
In my last post I discussed how to perform some CRUD operations using Ajax and the jQuery UI dialog window. In that posted I included a little gem which I did not point out and probably should have....
View ArticleASP.NET MVC: Displaying Client and Server Side Validation Using qTip Tooltips
The ASP.NET MVC framework makes it very easy to do both client and server side validation out of the box. Using DataAnnotations on your model properties the framework can display errors to the user...
View ArticleASP.NET MVC: Internal Server Error (500) on Action Method Returning Json Result
The ASP.NET MVC framework allows you to easily return Json from an action method. This makes jQuery Ajax calls very easy to implement, as shown below. The JavaScript...
View ArticleASP.NET MVC: Displaying Client and Server Side Validation Using Error Icons
In a previous post I showed how you could display both client and server side validation using qTip tooltips. In this post I will show how you can display an error icon next to the field that is...
View ArticleASP.NET MVC: LessThan and GreaterThan Validation Attributes
ASP.NET MVC ships with a handy Compare attribute that allows you to compare two inputs and display a validation message if they do not match. This is great for sign up pages where a password needs to...
View ArticleIE9 Bug: Div height grows on hover when overflow is set to auto
It turns out that if you have a div set to overflow:auto, the contents of that div are wider than the containing div, and you have an element with a :hover css class inside that div that IE9 will start...
View ArticleASP.NET APIController 500 Internal Server Errors
I had a situation where locally, calling an APIController method worked fine but when I uploaded the site to an Azure service, every time I called any method I would get back a 500 Internal Server...
View Article