Add Additional Information to Your Exceptions
When Enterprise Library was called Microsoft Application Blocks, if you wanted to log an Exception, you would write (assuming “ex” is an Exception): ExceptionManager.Publish(ex); And if you wanted to log some extended properties you could Read More...
Fun with #region
I am not sure if I did this on accident, or my intern did it, but I found this in my code: #region Constructors//code here #endregion Constructors I was not aware you can put a tag after #endregion. Kind of nice to clearly delineate long regions. Not Read More...
0 Comments
Filed under ,
Learning C# over VB.NET
I just finished writing a long 'ol email to a friend who wants to do a project in VB.NET since his background is in legacy ASP. Although my points have been illustrated by many over and over, I thought I would post what I wrote in the hopes others Read More...
84 Comments
Filed under ,
Hiding a Row in ASP.NET
Many things that I come across are "No Duh". This is one of them. I frequently see code from other programmers that incorrectly use Panel for the purpose of hiding content. What they don't understand is that a Panel tag renders a table, Read More...
10 Comments
Filed under ,
ReSharper Help and Tutorial
I have found that for me, ReSharper wasn't even close to as great a help until I changed my operating basis regarding how I write code. Many times there are many subtle things you do differently, which just causes pain with ReSharper. It also wasn't Read More...
Binding a DropDownList to an Enumeration
Ok, well its not really binding to it. But at least it is close : (foreach(EnumNameHere enum in Enum.GetValues(typeof(EnumNameHere))){ DropDownListNameHere.Items.Add( new ListItem(enum.ToString(), Convert.ToInt32(enum).ToString()) );} Pretty Nifty. I Read More...
String to Enum
I have to do this now and then and each time I don't write this code perfect the first time. I either forget the typeof statement or to cast, etc. But, if you have a string, “Yoda” and you want to set an Enum called "Jedi", this Read More...