Home > DeveloperSection > Forums > How to index view record information only current user
Anupam Mishra

Total Post:135

Posted on    March-18-2016 12:40 AM

 ASP.Net C#  ASP.Net  ASP.NET MVC  Mvc  View 

 1 Reply(s)
 266  View(s)
Rate this:

i have already code  in index view recorded only information about current user . My code is below:

 var req = db.permit.Include(e => e.User).Where(m => m.UserId == User.Identity.GetUserId());
        return View(req);
But it's not work. can anyone give me a solution.

Thank  you.

Sachin Singh
Sachin Singh

Total Post:26

Posted on    March-18-2016 12:45 AM

Hi Anupam,

If you are use this code, i think your problem probably be solved:

string userID = User.Identity.GetUserId();
var req = db.permit.Include(e => e.User).Where(m => m.UserId == userID);
return View(req);

Don't want to miss updates? Please click the below button!

Follow MindStick