Posts Tagged ‘C#’

Exception Handling in ASP.NET

August 5, 2010 Leave a comment

While running one or more ASP.NET websites, it is valuable to have a system where errors encountered by your users are automatically reported so that you can fix them. It is bad practice to let the user’s see the error and it is horribly evil to force them to report the errors themselves. The answer: an automatic exception handler. I developed this handler for use in websites so that any error encountered would be e-mailed to a list of developers as well as recorded to the server logs if desired.

Read more…

Categories: Development Tags: , , , ,

Extension Methods

April 12, 2010 Leave a comment

Have you ever been working with an object in managed code and thought “Boy, it would be nice if this object did this…”. Well, With extension methods, you can sort of append functionality to an existing type without having to use inheritance to create your own object. Now, there are a few caveats to this functionality that you should be aware of.

1. Extension methods must be static.
2. They must be methods. No properties here.

Read more…

Categories: Development, Tips Tags: , , ,