ASPForums.Net RSS Feedhttp://www.aspforums.net/Handlers/RSS.ashxLatest additions to the content that appears on ASPForums.Net(c) 2019 www.aspforums.com. All rights reserved.Send (Pass) Session value from View to Controller in ASP.Net MVC<p>Hi&nbsp;mahesh213,</p> <p>Session is used to store data on the server. It allows a controller to pass data to another controller.</p> <p>If you want to change a session value with jQuery, you must make an ajax call to an action that updates session.</p> <p>You can access the Session value in Controller without passing it through Ajax request.</p> <pre class="brush: csharp">public JsonResult getAll() { int Id = Convert.ToInt32(Session[&#34;EId&#34;]); db.Configuration.ProxyCreationEnabled = false; using (ReportEntities dataContext = new ReportEntities()) { var employeeList = (from E in dataContext.MenuSelection1 where E.EId == Id orderby E.Id select new { E.Id, E.ControllerName, E.Url }).ToList(); var JsonResult = Json(employeeList, JsonRequestBehavior.AllowGet); JsonResult.MaxJsonLength = int.MaxValue; return JsonResult; } }</pre> <p>And remove the parameter from Ajax call.</p>https://www.aspforums.net:443/Threads/117448/Send-Pass-Session-value-from-View-to-Controller-in-ASPNet-MVC/https://www.aspforums.net:443/Threads/117448/Send-Pass-Session-value-from-View-to-Controller-in-ASPNet-MVC/Wed, 17 Jul 2019 02:15:32 GMT