Helping you solve those tough coding problems!
Learn some great web development and web design tips and techniques through recipes that clearly define the problem being solved with a working solution.
Popular Tags: cakephp | theory | optimization | javascript-development | asp-net | css | jquery-development | sql | ajax | c

Search:
Follow @endyourif rss Facebook LinkedIn

Controller does not have a default constructor Controller does not have a default constructor

Published on Apr 8, 2019 by Jamie Munro

I use Ninjection for my C# MVC project. As I've discussed in Advanced Automatic Ninject Bindings Advanced my Ninjection is automated based on Interfaces matching Class Names. So when the dreaded Controller does not have a default constructor error occurs I have two common starting points.

Read more >

Tags: ASP.NET | mvc

Updating specific fields using Entity Framework Updating specific fields using Entity Framework

Published on Mar 25, 2019 by Jamie Munro

Entity framework does a great job of detecting when a field changes on any object that it is tracking. These changes will be automatically saved when SaveChanges is executed. As I discussed in Why the Repository Pattern I like to create a Generic Class that is type T where T is a Model in my Entity Framework Context. This example will extend upon those examples.

Read more >

Tags: Entity Framework | mvc

Posting form variables that are not strongly typed with MVC Posting form variables that are not strongly typed with MVC

Published on Mar 17, 2019 by Jamie Munro

In a lot of the MVC 3 examples that are available on the Internet today, they are quite typically strongly typed to a model, e.g. public ActionResult LogOn(LogOnModel model, string returnUrl).

This is extremely useful for the validation abilities and many other aspects; however, there are times when some or all of the data is not strongly typed; then what do you do? Read on for two different approaches.

Read more >

Tags: ASP.NET | mvc

Pass Model or Form Data with MVC when redirecting Pass Model or Form Data with MVC when redirecting

Published on Mar 13, 2019 by Jamie Munro

Have you ever wanted to pass form data or perhaps even a full model from one action to another through a RedirectToAction? By adding a new library package from NuGet, this can be accomplished with a few small changes to your controllers.

The first thing that needs to be done is to install the package through the NuGet package manager. Inside of Visual Studio, with the your MVC project selected select Tools -> Library Package Manager -> Add Library Package Reference… On the left hand side, select the Online button. Then, in the search field, type MvcContrib and install the base package.

Read more >

Tags: ASP.NET | c# | mvc

Creating your own UrlHelper Extension with MVC Creating your own UrlHelper Extension with MVC

Published on Mar 9, 2019 by Jamie Munro

When you have a website with a lot of static content: images, Javascript, CSS, etc… you will find yourself constantly typing out the same path information with the exception of the name of the actual file. Creating a class extension to the UrlHelper can help greatly reduce your development efforts with a few simple additions.

Read more >

Tags: urlhelper | ASP.NET | Theory | mvc

MVC: Accessing the RouteData inside of your C# code MVC: Accessing the RouteData inside of your C# code

Published on Feb 27, 2019 by Jamie Munro

Unit Testing Data Validation with MVC Unit Testing Data Validation with MVC

Published on May 11, 2015 by Jamie Munro

Integrating Automapper with an MVC Result Filter Integrating Automapper with an MVC Result Filter

Published on May 4, 2015 by Jamie Munro

Advanced Automatic Ninject Bindings Advanced Automatic Ninject Bindings

Published on Jan 13, 2014 by Jamie Munro

Automatic Ninject Bindings Automatic Ninject Bindings

Published on Jan 7, 2014 by Jamie Munro

My First Node Application My First Node Application

Published on Oct 4, 2012 by Jamie Munro