This is a useful time saving technique for ASP.NET C# 3.0 that allows any future re-implementation of the properties.
In C# 2.0 (and often still in C# 3.0), properties of a class are defined as a private variable and encapsulated within a public getter/setter as follows. The thing is with this though is that it [...]
Often it is useful to check whether or not a string is actually a Guid, especially useful if you pass guid querystrings between pages to identify things like users, videos or blogs etc.
One way you could do this is to user a try catch around a new Guid(String) statement but its bad practice [...]
I got this exception after 2 minutes or so of waiting when consuming an RSS feed from Digg.com. It was strange seeing as the feed loaded instantly when I viewed it in a browser.
I discovered I could solve the problem by adding the following line of code (where the object req is a HttpWebRequest [...]
Normally if you’re looping through a list of items in a ListBox (or CheckBoxList etc) you’d probably do something like this:
That’s great and works well, but I though ‘How could I do this using LINQ?’. This is how:
This may be a trivial example and is a longer way of doing the [...]
Here are a few small code snippets that I find really useful and use almost on a daily basis. Hopefully you’ll find them as useful as I do.
ResolveUrl()
Great for referencing files that are in the other directories in your app – for example including a javascript file that is in [...]
-
Calendar
May 2012 M T W T F S S « Mar 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 -
Meta

