Nov 162011
 

Given most programming problems there is an almost endless number of ways to implement a solution for even the most simple task. One of those tasks that many take for granted is string manipulation. When talking to a friend recently about this it brought up the question of which method is faster and better performing. So I decided I needed to look at execution speeds and memory usage of three of the main string manipulation implementations; String.Format, StringBuilder and String Concatenation. Continue reading »

Apr 152011
 
While writing a large series of in-line if / else statements I came across a very fundamental question.  Which one is faster, in-line if / else statements or your standard if / else statement block?  No matter who I asked no one seemed to have a good answer, so I took it upon myself to find one.We can all probably agree that in-line if statements certainly take up less space and some may argue that the are much cleaner code.  And to be fair the more I’ve used in-line statements the more I’ve come to like them.  But the question still remained, in the realm of performance which one was faster. Continue reading »
Apr 022010
 

With the implementation of MVC there is a lot more room for unhanded global exceptions because in MVC you are encouraged to write more in line code to accompany the back end code. So what happens when an exception is thrown within the front end code? Well you’ll have an exception that will bubble up to the global application class which if you don’t handle it there it will continue to bubble and be displayed to the user as specified in the web configuration file. This doesn’t do you much good, sure the user will know that there is an error, and you can squelch the amount of information that is displayed to your ordinary users, but if working through trouble shooting the issue this basic information does you no good. Continue reading »

Jan 192010
 

Recently we had a client ask us to add a label in front of the paging control on an ASP.NET gridview numeric paging control so that users would know what the numbers meant. This seemed like a reasonable request as we were dealing with users who may not be the most tech savvy, plus it didn’t seem like there would be much work that would need to be put in to accomplish this goal. To understand the solution you need to understand the steps at which it took to get there.

The first thing I tried was modifying the PagerTemplate, but little did I know that in ASP.NET when you modify this template on a GridView you overwrite the entire paging control. This obviously wasn’t what I wanted, I just needed to add a little text in front of all the page numbers, I didn’t want to rewrite it entirely. Continue reading »