public ActionResult CreatePost(string taskListOwnerId, string taskListId)
        {
            var currentUser = (User) Session["CurrentUser"];
            var container = _taskListsService.Get(t => t.PartitionKey == taskListOwnerId && t.RowKey == taskListId);
            var note = new Note { Owner = currentUser, Container = container };

            // Only a user in the note's containing tasklist share list can create a new note.
            if (!_taskListsService.HasPermissionToEdit(currentUser, container))
            {
                return View("Info", "_Layout", string.Format("The user '{0}' doesn't have permission to create a note in the tasklist '{1}'.", currentUser.Name, container.Title));
            }

            try
            {
                TryUpdateModel(note);

                // Check if a note with the same title already exists.
                var noteWithSameTitleExists = _notesService.NoteWithTitleExists(note.Title, container);

                if (noteWithSameTitleExists)
                {
                    ViewBag.ValidationErrors = new List<ValidationResult> { new ValidationResult(string.Format("The note with the title '{0}' already exists.", note.Title)) };
                    return View(note);
                }

                if (note.IsValid())
                {
                    _notesService.Create(note);
                    return RedirectToAction("Index", new { taskListOwnerId = container.PartitionKey, taskListId = container.RowKey });
                }
                else
                {
                    ViewBag.ValidationErrors = note.GetValidationErrors();
                }
            }
            catch (Exception ex)
            {
                ViewBag.ValidationErrors = new List<ValidationResult> { new ValidationResult(string.Format("Create Note exception: {0}", ex.Message)) };
            }

            return View(note);
        }