0

When to use TempData in ASP.NET MVC

Posted by Tim on December 5, 2011 in MVC

The problem I came across this problem where I had a basic list of items and for each if these items I wanted to add a delete action on my controller. I wanted to add some error checking around the delete action so if someone attempted to modify the URL and enter a incorrect parameter [...]

Tags: ,

 
1

Areas and ASP.NET MVC Routes Tip

Posted by Tim on August 28, 2011 in MVC

Lets say that you have several areas define in your ASP.NET MVC solution. You find that when you run your application you get the following error “Multiple types were found that match the controller named ‘Home’.”. This is because ASP.NET MVC finds all the routing definitions (i.e in each area.cs file or the global.asax) and [...]

Tags: , , ,

 
0

Elmah and MVC 3 Error Handling

Posted by Tim on July 12, 2011 in ASP.NET, MVC

I came into an issue where I have Elmah configured on a ASP.NET MVC 3 website. I notice that the errors were not getting logged or emailed as per my configuration settings in web.config. I found that MVC3 Error Handling was handling all the errors before Elmah could handle the error and report it correctly. [...]

Tags:

 
0

Compiler Error Message: CS1973

Posted by Tim on February 6, 2011 in MVC

I came across this error when I was trying to use the @Render method to render a view while passing through a object that will act as the model for that view. Compiler Error Message: CS1973: ‘System.Web.Mvc.HtmlHelper’ has no applicable method named ‘Render’ but appears to have an extension method by that name. Extension methods [...]

Tags: ,

 
1

Disabling Request Validation with ASP.NET MVC

Posted by Tim on February 1, 2011 in C#, MVC

Sometimes when dealing with POSTS and form data, you need to disable Request Validation to allow HTML/scripting data into your methods.   Traditionally with Web Forms you use <%@ Page ValidateRequest=”false” %> which turns off Request Validation, just be aware that this doesn’t work with ASP.NET MVC. You apply the [ValidateInput] attribute to the controller action [...]

Tags:

Copyright © 2008-2012 Codelab Blog All rights reserved.
Desk Mess Mirrored version 1.9.1 theme from BuyNowShop.com.