hello friends.
i want to fetch record by using "session".
i want to get record of particular logged user.
i am using this. bit it not working.
==========================
Code
public class UserController : ControllerCode
{Code
private Entities db = new Entities();Code
public ActionResult Index()Code
{Code
int userId = (int)Session["LoggedUserID"];Code
var user = db.Users.SingleOrDefault(u=>u.UserId==userId);SQL
if (user != null) return View(user); // this return View();Code
}Code
}Code
please help me.Code
Code
Code

Manas MohapatraRank #182 · 13.2K reputationPosted Oct 1, 2017, 9:57 PM EDT
RinkiRank #4,402 · 346 reputationPosted Oct 1, 2017, 11:06 PM EDT