I love the null-coalescing operator because it makes it easy to assign a default value for nullable types.
int y = x ?? -1;
That\'s great,
create an auxiliary function
public static String GetValue( string key, string default ) { if ( Session[ key ] == null ) { return default; } return Session[ key ].toString(); } string y = GetValue( 'key', 'none' );