What is the best way to check for the existence of a session variable in ASP.NET C#?
I like to use String.IsNullOrEmpty() works for strings and wonder
String.IsNullOrEmpty()
Are you using .NET 3.5? Create an IsNull extension method:
public static bool IsNull(this object input) { input == null ? return true : return false; } public void Main() { object x = new object(); if(x.IsNull) { //do your thing } }