public void Session_OnStart() { DataService data = new DataService(); List<Portlet_User> _dsSession = new List<Portlet_User>(); List<Category> _dsApplication = (List<Category>)Application["data"]; foreach (Category category in _dsApplication) { foreach (Portlet row in category.Portlets) { int userid = Session.Count + 1; var portlet_User = new Portlet_User() { CategoryID = row.CategoryID ,UserID = userid ,Portlet_ID = row.Portlet_ID ,Column_No = row.Column_No ,Row_Sequence = row.Row_Sequence ,Title = row.Title ,Is_Image_Allowed = row.Is_Image_Allowed ,Is_Active = true ,Category = category ,Portlet = row ,User = new User() {UserID = userid,Name = userid.ToString()} }; _dsSession.Add(portlet_User); } } Session["data"] = _dsSession; }
// // GET: /Services/ public ActionResult Index(int ID=0) { DataService data = new DataService(); var page = data.GetPageByID(1); return View(page); }
protected void Application_Start() { AreaRegistration.RegisterAllAreas(); RegisterRoutes(RouteTable.Routes); // RouteDebug.RouteDebugger.RewriteRoutesForTesting(RouteTable.Routes); DataService data = new DataService(); Application["data"] = data.Complete(); }