This was a microsite for a promotion to run along with the release of the Adventures of Tintin movie. It was built with ASP.NET MVC 3 and the Entity Framework.
The site provided a way for store owners and managers to register and submit photos of their Alouette Cheese Tintin branded in-store displays.
The photos could be voted for as part of a contest for the best looking display.
The registration form allowed individuals to upload multiple images. I looked at several options and decided to use the jQuery Multiple File Upload Plugin.
The plugin allowed you to determine the maximum number of uploads, the allowed file types and maximum file size. It was also easy to style the generated controls to fit the tight space on the registration form.
The registration form was set up to allow five images at one megabyte each.
Images were uploaded to a protected folder to prevent their viewing before they could be approved.
A admin section was created to view registrations and view and moderate images.
A email was sent to notify the admins that there were images to approve.
I used the RazorEngine Nuget package so that I could create views that I could data bind to. I then relied on the WebMail Helper to send the email out.
When an image was approved I created a thumbnail and full-size page view of it. Each image was assigned an short-unique identifier which would be used as a slug for the photo’s URL.
The short-unique identifier was generated with a Base62 encoder and it also required making the database table case sensitive.
The admin was secured with an Authorize attribute, using the provided login form from Microsoft to validate against a simple membership database.
The gallery section needed to allow paging and searching by location.
For paging I used the PagedList Nuget package.
The search feature on the gallery was to search for images that belonged to a registration from a specific city. It was just a simple start-of text search against the registration data.
Voting was handled by calling a stored procedure to retrieve the current votes for an image and updating it by one.
Overall it was my first experience building a website with MVC 3 and the Entity Framework. The ability to auto generate the database, tables and associations, in a code-first manner was very nice.
It was also a opportunity to make use of several Nuget packages, including ELMAH for error logging.
Even the default layout and styles provided by Microsoft made building the admin faster.