Beispiel #1
0
        public ActionResult CreateTask(SPTask task, string SPHostUrl)
        {
            var spContext = SharePointContextProvider.Current.GetSharePointContext(HttpContext);

            using (var ctx = spContext.CreateUserClientContextForSPHost())
            {
                if (ctx != null)
                {
                    TaskHelper.Addtask(ctx, task);
                }
            }
            return(RedirectToAction("Alltasks", new { SPHostUrl = SPHostUrl }));
        }