Tag Archives: ASP.NET

Displaying Validation Errors with ASP.NET MVC

We all know how important it is to validate user input, but it’s equally important how we present validation errors to the user. Take the following form: The email field needs to be optional but any address entered must be … Continue reading

Posted in Tips and Tricks | Tagged , , , | Leave a comment

ASP.NET MVC – Cannot create an instance of an interface

I came across an error message recently that I hadn’t seen before: The error occurred when I tried submitting the following form: The stack trace suggested it came from the model binder: [MissingMethodException: Cannot create an instance of an interface.] … Continue reading

Posted in Tips and Tricks | Tagged , , | Leave a comment

Wrapping JsonResults in ASP.NET MVC

Like a lot of web developers I like to load page content dynamically but this can cause problems if the Ajax request causes an error on the server. Timeouts can be handled in jQuery but what if the user needs … Continue reading

Posted in Reference, Tips and Tricks | Tagged , , , | Leave a comment

Controller TempData in ASP.NET MVC 3

I found an excellent article today over on Stack Overflow on how to pass arbitrary data between action methods. The solutions posted by Ryan Tofteland and Tomas Lycken both argue for using a feature of controllers I hadn’t come across … Continue reading

Posted in Tips and Tricks | Tagged , , | Leave a comment

Dropdown Lists in MVC 3

I’ve been lucky enough to work full-time with ASP.NET MVC 3 for the past couple of months, and I’ve completely fallen in love. It’s quite a change from WebForms, and it took a while to ‘click’ so I’m putting together … Continue reading

Posted in Tips and Tricks | Tagged , , | 15 Comments

ASP.NET Numeric TextBox Server Control

Update This post is more of a demonstration for how to write a Web Forms Server Control, than a numeric text box. If you’re looking for a slicker solution using jQuery then I’d recommend reading this. Download NumericTextBox.zip (20 KB) … Continue reading

Posted in Reference | Tagged , | 12 Comments

ASP.NET Creating User Controls Programatically

User Controls are a great way to share functionality between pages, but sometimes you may want to create one on-the-fly. Although simple to do, there is a trick to doing this… The User Control Add a new user control to … Continue reading

Posted in Uncategorized | Tagged | 1 Comment