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??
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Manas MohapatraPosted Sep 6, 2015, 9:00 AM