When creating a post an error occurs 
Here is the implementation of the post itself
[Authorize] [HttpGet] public ActionResult AddNewPost() { List<int> numlist = new List<int>(); int num = 0; var posts = _blogRepository.GetPosts(); if (posts.Count != 0) { foreach (var post in posts) { var postid = post.Id; Int32.TryParse(postid, out num); numlist.Add(num); } numlist.Sort(); num = numlist.Last(); num++; } else { num = 1; } var newid = num.ToString(); PostViewModel model = new PostViewModel(); model.ID = newid; return View(model); } [Authorize] [HttpPost] [ValidateAntiForgeryToken] [ValidateInput(false)] public ActionResult AddNewPost(PostViewModel model) { var post = new Post { Id = model.ID, Body = model.Body, Meta = model.Meta, PostedOn = DateTime.Now, Published = true, ShortDescription = model.ShortDescription, Title = model.Title, UrlSeo = model.UrlSeo }; _blogRepository.AddNewPost(post); return RedirectToAction("EditPost", "Blog", new { slug = model.UrlSeo }); } 