Shibly  Sadik

Shibly Sadik

  • NA
  • 167
  • 139k

Passing error message from controller to view

Sep 6 2015 8:15 AM
I want to do something like below.
 
//Controller
 
if(Session["UserId"]!=null)  // If user is logged in
{
   return View(db.Orders.ToList());
}
else
{
    //return a error message on the same view
}
 
how to to that??

Answers (1)