I am trying to assign null to the variable IdSubCategory if the session variable Session["SubCategory"] is null
Why does the following not work?
decimal tmpvalue2;
decimal? IdSubCategory = null;
if (decimal.TryParse((string)Session["SubCategory"], out tmpvalue2))
IdSubCategory = tmpvalue2;
I usually wrap my session variables in a property.