In the below snippet, I am trying to assign the cache value if the cache value does not already exist. I get an Object_reference_not_set_to_an_instance_of_an_object error when running the following. What am I missing?
if (string.IsNullOrEmpty(HttpContext.Current.Cache[Key].ToString()))
HttpContext.Current.Cache[Key] = data;
I looked around on SO but couldnt find something similar. Maybe I am just not wording my problem correctly.