ASP.NET News from Blogger: K. Scott Allen   Get the feed of: K. Scott Allen

Total News: 394

Pretty Code #1 Building SelectListItems

In ASP.NET MVC, you can use a collection of SelectListItems to help build an HTML <select>. Just watch out for the HTML helper overloads. The question is what is the prettiest code that can cha...

Three IIS Concepts ASP.NET Developers Should Know

Its possible to do a lot of work with ASP.NET and not know anything about IIS, particularly if you work with a large team where IT specialists keep the riff-raff away from pro...

Principals, Code-Behind, & View Engines

The July issue of MSDN Magazine is available online with my article Guiding Principles For Your ASP.NET MVC Applications. Another MVC article in this issue is Justin Etheredges Building Testable ASP.N...

Functional Programming Battles GOTOzilla

Steve Wellens had a recent blog post arguing for the use of a goto in C# (see: Why goto Still Exists in C#). Steve had a series of methods he wants to execute, but he wants to stop if any given method...

Progressive .NET Event In Stockholm

redev is putting together an exciting lineup of topics and speakers for Progressive .NET Days. The event is August 27-28 in Stockholm Sweden. Progressive software development understands that tomorr...

When Do I Use Interfaces?

Program to an interface, not an implementation is a well-known mantra from the GoF book. Take this guidance to an extreme, though, and you generate POO instead of OOP. How do know if you crossed the ...

From LINQ to XPath and Back Again

Lets say you wanted to select the parts for a Lenovo X60 laptop from the following XML. <Root> <Manufacturer Name="Lenovo="> <Model Name="X60=" > <Parts> ...

Catching Up On Lean

I now have a number of lean software development books queued up. It started when I saw this single bullet point in a presentation: Overproduction == Extra Features Im enjoying the thinking behind le...

Don't Ask Me If It's Possible

Years ago, ex-Googler Doug Edwards wrote a blog post to explain the meaning behind a few favorite words in the software developers vocabulary: orthogonal, cruft, canonical, and the big one - non-trivi...

Iterating on an ASP.NET MVC Model Binder

After my last post on model binding tips Ive had a number of questions about the nuances of model binding. Lets work through a sample. Imagine you have a Recipe class that can hold all the informatio...

6 Tips for ASP.NET MVC Model Binding

Model binding in the ASP.NET MVC framework is simple. Your action methods need data, and the incoming HTTP request carries the data you need. The catch is that the data is embedded into POST-ed form v...

Life and Times of an ASP.NET MVC Controller

The May issue of MSDN Magazine is now on-line with my article The Life and Times of an ASP.NET MVC Controller. In this article, I will dissect the ASP.NET MVC framework and look at how controllers w...

ASP.NET MVC Controls and Good versus Evil

Luis and David recently posted about the controls that appear in the ASP.NET MVC Futures 1.0 release. Luis Abreu: The MVC framework: the Repeater control David Hayden: ASP.NET MVC Controls in ASP.NE...

MVC Course is Coming Online!

Just a quick note to let you know that the first three modules of my ASP.NET MVC course are ready for consumption at Pluralsight! On-Demand. Pluralsight is building a fantastic library of online cont...

Putting the M in MVC Part III

In the last post we talked about using entities as the models in an MVC application. This approach works well until an application reaches a certain level of complexity, at which point entities as the...

Putting the M in MVC Part II

Rob just put the M into MVC using Subsonic and a Subsonic MVC Template. The template allows you to go from 0 to functioning application in less time than it takes to listen to a Rob Zombie song. Fanta...

Euphemized Exceptions for .NET 4.0

Microsoft has discovered, after several well-funded studies, that the names they use for exceptions in the .NET framework create pathological levels of anxiety and stress in programmers. Thus, for .NE...

Putting the M in MVC Part I

Model is one of those overloaded words in software. Just saying the word model can produce a wide range of expectations depending on the context of the conversation. There are software process models,...

Downloads and Links from DevConnections 2009 Orlando

The ASP.NET Connection show in Orlando was a fantastic event. Thanks to everyone who came to a session. Here are the slides and demos for everyone who asked for them. What ASP.NET Developers Should ...

Signs That Your JavaScript Skills Need Updating

JavaScript has made some improvements in its state of the art over the last several years, despite your best attempts to ignore the language. Yes, you. The language hasnt changed, but the tools, pra...

What I Do When My jQuery Code Doesnt Work

When my jQuery code doesnt work, it usually means Ive done something terribly wrong with my selectors. Thus, my first rule of debugging code that uses jQuery: Make sure the selector is actually select...

Client Rendering Views with Spark and ASP.NET MVC

Spark is a view engine for the ASP.NET MVC and Castle Monorail frameworks. Ive been wanting to try this creation by Louis DeJardin for some time, but ScottW pushed me over the edge with If you are usi...

NerdDinner.com and Two Views of ASP.NET MVC Views

Phil and Scott  (and the other Scott) announced the open source Nerddinner.com project and their free ASP.NET MVC eBook today. Actually, the free eBook is a single chapter of 185 pages, which is ...

What Are The Never Events for Software Quality?

Recent talk centered on software quality got me thinking of never events. The never events in health care are defined by the National Quality Forum to identity serious problems in the quality of a he...

Thoughts on the Code Contracts Preview for .NET 4.0

A new Code Contracts preview is now available on DevLabs. Code Contracts will be part of the base class library in .NET 4.0 (included in mscorlib), and facilitate a Design by Contract programming appr...

Mapping Objects with AutoMapper

At the end of last year I finished a project that required a fair amount of object-to-object mapping. Unfortunately, Jimmy Bogard didnt release AutoMapper until this year, so I had to write a pile of ...

Why Would I Create A Custom LINQ Operator?

Here are three different reasons: For an operation that doesnt exist. For readability. For performance. An example for reason #1 is Bart De Smets ForEach operator. While you are on Barts blog, you c...

More LINQ Optimizations

Not every optimization is a performance optimization. Imagine trying to get this XML:string xml = @"<people> <Person> <property value=""John"" name=""first...

Due Diligence and Code Comments

This is the silly tale of a strange due diligence process I experienced. It happened several years ago but I couldnt talk about it at the time.  Ive been on both sides of the technical due dilig...

Thoughts on AJAX Preview 4 and JSINQ

ASP.NET AJAX 4.0 is adding client-side templates. You can bind data in the browser using declarative markup, imperative JavaScript code, or mix and match both approaches. The purely declarative approa...

Whats Wrong With This Code? (#21)

This version of WWWTC is dedicated to closures. We can use closures and functional programming in general to create elegant, succinct solutions, but sometimes we can also create subtle bugs.  Ex...

Routing and Rewriting

ASP.NET 3.5 includes a URL routing engine and IIS 7.0 can use a URL re-writing engine (x86) (x64). Routing and rewriting sound very similar, but so do robbing and rewarding you cant judge features us...

Astonishment Principles and Framework Behavior

The Principle of Least Astonishment (a.k.a the principle of least surprise (POLS)) is a guiding design principal for UIs, APIs, and interfaces of all types. Peter Seebach says: Throughout the history...

App Configuration and Databases

Jeffrey Party With Palermo recently posted on Separating configuration from data lowers total cost of ownership: My recommended progressions of configuration locations are as follows.  Specific ...

A Message For You

This years silly, obfuscated, console mode C# program is brought to you by LINQ. using System.Linq; using Electricity = System.Collections.Generic.IEnumerable<char>; using here = System.Collecti...

Units of Work

The Unit of Work (lets call it UoW) is another common design pattern found in persistence frameworks, but its new to many .NET developers who are just starting to use LINQ to SQL or the Entity Framewo...

XM Radio Player Part III : Choices

WPF, AJAX, or Silverlight RIA?I gots more options than a block of Velveeta.XBAP? XCOPY? XAP files are just ZIPs!Let me run my bits on your silicon chips. When I started to think of what my XM Radio P...

Identity Maps

There are a couple of important patterns in play when you use a persistence framework. These patterns have been around for quite some time but are relatively new to .NET developers who are jumping int...

XM Radio Player Part II : Scraping

Just to make sure everything was as easy as it looked in Fiddler I wrote a quick and dirty piece of throwaway code to see if I could programmatically  login to XM and play a stream of music with...

Leeroy Jenkins in Software Development

The Jenkins video always makes me laugh. Its the short and sad tale of a man who doesnt have the patience for planning, nor the stamina for statistical analysis. Hes a man who leaps into action witho...

Single Letter Variable Names Still Considered Harmful

There is a lot of humor in the Bad Variable Names entry on the c2 wiki. I like this confession from Alex: The worst of which was my counter variable names. I now use i, j, k, and so on for local coun...

Mapping with Expressions

Once you know about the magic of Expression<T>, its hard not to make use of it. Or perhaps, abuse it. Here is an excerpt of a class I wrote that uses Expression<T> as a reflection helper...

Expression Magic

In the last post we talked about needing some Expression<T> background. There is a lot of good information out there about Expression<T>, but if you havent heard this class is pure magic....

Fluent Interfaces and Flowcharts

In a previous post, I talked about modeling flowcharts with C# code. The flowcharts are designed, documented, and standardized  by a non-profit  organization charged with measuring the quali...

The Estrangement of LINQ to SQL

Tim Mallalieu, PM of LINQ to SQL and LINQ to Entities, recently announced: as of .NET 4.0 the Entity Framework will be our recommended data access solution for LINQ to relational scenarios. Tim later...

Modeling Flowcharts

A few months ago I worked on a system that was based on a set specifications that included some gnarly flowcharts (see pages 7 17 for an example). The good news was that the specs were concrete and r...

Lazy LINQ and Enumerable Objects

Someone asked me why LINQ operators return an IEnumerable<T> instead of something more useful, like a List<T>. In other words, in the following code:List<Book> books = new List<Bo...

Stupid LINQ Tricks

Over a month ago I did a presentation on LINQ and promised a few people Id share the code from the session. Better late than never, eh? We warmed up by building our own filtering operator to use in a ...

Visual Studio SP1 and The Metification of REST

Metification verb The act of adding metadata to a web service in order to facilitate tooling and discovery. The act of adding complexity to a web service in order to achieve tight coupling. Pick ...

Optimizing LINQ Queries

Ive been asked a few times about how to optimize LINQ code. The first step in optimizing LINQ code is to take some measurements and make sure you really have a problem.    It turns out th...

View Other bloggers

Product Spotlight