Jika Viewbag Null

@if (ViewBag.YourKey== null)
{
 //your code   
}
Mahmoud Nasr