Simple little things. Issue commands using CommandName and CommandArgument in a GridView control

Posted Posted in .Net, ASP.NET, C#, Simple little things

Handling events in ASP.NET is not always as straightforward as it seems. One particular pattern that often occurs is that there’s several items in a row in a GridView control that trigger commands. Now the GridView supports several standard commands such as Select and Delete, but what if you want to issue your own command? As an example, here’s my […]

Simple little things. The 42 extension method anti-pattern

Posted 2 CommentsPosted in .Net, Anti-patterns, C#, Extension methods, Frameworks, Simple little things

Extension methods are a powerful feature in .NET, and have been increasingly adopted by the developer community. Also, LINQ and other framework features rely heavily on extension methods. In fact, extension methods were originally invented to be able to implement LINQ without having to change a lot of .NET framework base classes. Basically, an extension method is implemented as a […]

Simple little things. Placing dynamic images in databound controls

Posted Posted in .Net, ASP.NET, C#, Simple little things

Sometimes there’s these really little things that hardly seem worth the effect blogging about. But when you start googling for the apparent solution, there’s a million-and-one blogs, forum questions that at the least are contradicting. In this particular case I wanted to set different images in different rows in a Repeater or GridView depending on some property of the domain […]