MVC

Sep 21 2009

Enum DropDownList in ASP.NET MVC

I created an HTML Helper for rendering a dropdownlist aka select element from the name/value pairs in an enum and thought I would share.

Aug 31 2009

Null strings in ASP.NET MVC 1.0 with DataAnnotations

After getting DataAnnotations working with ASP.NET MVC 1.0, I noticed a strange anomaly. Values that were previously bound as empty strings were now being bound as null values.

Aug 31 2009

DataAnnotations in ASP.NET MVC 1.0

DataAnnotations is the Microsoft way of declaratively adding validation rules to a model. You simply add an attribute to a property and voila, it has validation! The concept of DataAnnotations should be familiar to anyone who has worked in Ruby on Rails and added validation rules inside the ActiveRecord model. I'm going to go over some of my findings and walk you through using DataAnnotations. Hopefully my pain, will be your gain.

Feb 10 2009

Nested Select Elements in ASP.NET MVC using jQuery and AJAX

I was looking for a nice simple implementation of nested select controls in ASP.NET MVC and... low and behold couldn't find anything to my satisfaction. So, I decided to write my own simple method for doing it using jQuery, JSON, and a little MVC magic.

Jan 22 2009

A Different MVC

MVC (model view control) was the "hot new item" ever since Ruby on Rails came out. Here at Ramsay Corporation we have not ignored the current trends. However, being somewhat limited to the ASP.NET and C# platform and language, respectively, we developed a slightly ...different way to implement "MVC".

Jan 21 2009

Redirection Filter in ASP.NET MVC

An interesting problem I've run across numerous times while developing MVC applications is that you occasionally want to make a controller action require specific user access. MVC allows for an implementation using Roles, but what if you need additional logic? Luckily, you can create a filter to do just that, and I'll show you how.

Jan 13 2009

Return URL's in ASP.NET MVC Postbacks

One of the neat things about the ASP.NET MVC framework is the ability to reuse bits of user interface code. A problem can present itself when you create a reusable view that posts data. Hard coding a redirect can lead to a difficult and frustrating user experience. I'm going to show you a simple way to redirect back to the originating page.

Recent comments