예제 #1
0
        public ActionResult SessionView(SessionViewModel viewModel)
        {

            if (ModelState.IsValid)
            {
                // Store registration     
            }

            SessionViewModel vm = viewModel;
            try
            {
                var dataItem = Sitecore.Context.Database.GetItem(RenderingContext.Current.Rendering.DataSource);
                vm = new SessionViewModel(dataItem ?? PageContext.Current.Item);
                    
            }
            catch (Exception)
            {
                return View(_viewPath, vm);
            }
            return View(_viewPath, vm);
        }
예제 #2
0
 public ActionResult SessionView()
 {
     var dataItem = Sitecore.Context.Database.GetItem(RenderingContext.Current.Rendering.DataSource);
     var viewModel = new SessionViewModel(dataItem ?? PageContext.Current.Item);
     return View(_viewPath, viewModel);
 }