Hi,
Most probably Session["CartItemCount"] does not have a value inside.
Change the following line please:
int LocalCartItemCount = (int) Session["CartItemCount"];
for
int LocalCartItemCount = Session["CartItemCount"]==null ? 0 : Convert.ToInt32(Session["CartItemCount"]);
good luck,
jafc