The Coding Humanist

Category: ASP.NET MVC

Markup for Desktop and Mobile

-- Filed Under: CSS, ASP.NET MVC, Html, Javascript, Mobile Web
Comments: (0)

So you know how to use the viewport meta tag to control some things about how mobile browsers render your page, you know about media queries and how you can use them to tweak your css for different sizes of monitors, and you know about progressive enhancement, and that everything doesn't actually have to look the same on every browser. Now let's get very practical. Let's say you want to build a website that will work for both desktop and mobile. You can do this easily in some circumstances but in others it can be a harder task. Here are some questions to ask yourself.

Read More on "Markup for Desktop and Mobile" >>

Full Stack Day

-- Filed Under: CSS, ASP.NET MVC, Html, Javascript
Comments: (2)

I have always been a "full stack" kind of guy. When I started teaching myself to program back in 2003, I had an app in mind that required a some knowledge of css, databases, and everything in between. At the time I didn't even really know what those were but eventually I figured it out. I'm doing Full Stack Day to help others get started with all the technologies you need to build websites.

Read More on "Full Stack Day" >>

The last few days I have been digging into the Javascript history api and in the process built a jQuery plugin that I figured others might find useful. It is actually very simple. I will be blogging about the Javascript history api next week and this will be used in those, so you can consider this a teaser as well if you are interested in the topic.

Read More on "Creating an Ajax Content Switcher with jQuery and ASP.NET MVC" >>

Auto Page-Specific Css with ASP.NET MVC

-- Filed Under: CSS, ASP.NET MVC
Comments: (0)

As a developer who wants to be conscious of good client-side practices, I’m always looking for good ways to keep my Css separate from my Html. When there are page-specific css styles to apply, it is often tempting to add them to the page itself. It works, it's not evil but I wouldn’t recommend it. Here’s an easy trick I have used on several projects to make it easy to target page-specific design problems in a global css file without worrying about adversely affecting other pages.

Read More on "Auto Page-Specific Css with ASP.NET MVC" >>

The purpose of a ValueProvider is to provide values from a source of data. There are several types of value providers built into the framework. They pull values from form posts, query strings, route data, posted files and other things. They exist to pull data from various data sources to supply to the model binding system so you can get your values on your action methods. But if you are reading this blog post, you probably already know what value providers are in ASP.NET MVC. So we will move on to getting them hooked up with our StructureMapDependencyResolver.

Read More on "StructureMap, Value Providers and Dependency Injection in ASP.NET MVC 3" >>

As you can tell by now, I’m not one who feels he has to avoid long titles for blog posts. We are continuing our work on exploring our options for dependency injection in ASP.NET MVC 3, with StructureMap as our IoC tool of choice. In our first post we got started with IDependencyResolver, in the second post we setup model binders and in the third we setup non-global action filters. In this post we will discuss global filters and the normal caveat applies: I have seen no clear guidance on this so I am kinda making this up as I go along. It works, but that is about all that I can promise you.

Read More on "StructureMap, Global Action Filters and Dependency Injection in ASP.NET MVC 3" >>

In our last post we setup the basic dependency resolver infrastructure for StructureMap. Our sample code is still hosted up on Github, so go get if you want to take a look at it. The same caveat to the last discussion still applies: since I know of no samples where StructureMap is used for a full implementation of the IoC hooks in ASP.NET MVC 3, I am kinda making it up as I go along. It is certainly working but time will tell how close my implementation ends up to being awesome. Now that this is out of the way, we need to push on because as is we are in little shape than we were in ASP.NET MVC 2 in terms of IoC support. So let’s start with getting dependency injection going for model binders.

Read More on "StructureMap, Model Binders and Dependency Injection in ASP.NET MVC 3" >>

I have become a big fan of the principle of dependency inversion over the last couple years. My tool of choice is StructureMap though I use Unity at work. It actually matters little which you use if you choose to use an IoC library. Much more important is your understanding of the principle and using that to make your software better. But this post is not here to discuss the meanings of these terms; its point is simple: How do you hook up StructureMap to ASP.NET MVC 3’s new IoC hooks?

Read More on "StructureMap and ASP.NET MVC 3 – Getting Started" >>

New Series on HowMVCWorks

-- Filed Under: ASP.NET MVC
Comments: (0)

Time to get this new year started! Today I am starting a new series on http://www.howmvcworks.net on models, view models and related issues. I few weeks ago I asked for suggestions on tutorials and both @jasona and @samdelagarza suggested material around validation and model binding. This series will cover both topics and more. If anyone has suggestions or requests, please let me know.

Read More on "New Series on HowMVCWorks" >>

ASP.NET MVC RC Available!

-- Filed Under: ASP.NET MVC
Comments: (0)

I haven't tried upgrading an existing site yet, but new website creation works well. The only thing I've seen so far is that if you create a unit test project to go with your web app it won't compile. Luckily, all you have to do is include the proper namespace reference to your controllers at the top.

Read More on "ASP.NET MVC RC Available!" >>