If varible is string, then to check if it is null use:

if (containerid.IsNullOrEmpty())
{  containerid = "-1"; }

Or String.IsNullOrEmpty()

Because null is not empty...