public ActionResult submit2(string IdPost) { TuViPhongThuyContext db = new TuViPhongThuyContext(); string gender = "female"; var PostRow = db.GhepDoiTinhDuyenPosts.FirstOrDefault(a => a.IdPost == IdPost); // Convert datetime in SQL to Datetime in these string dt = PostRow.Birthday.ToString(); DateTime dtt = Convert.ToDateTime(dt); string birthday = dtt.ToString("yyyy-MM-dd"); //DateTime dt = DateTime.ParseExact(PostRow.Birthday.ToString(), "yyyy-MM-dd", CultureInfo.InvariantCulture); if (PostRow.Gender.Value) { gender = "male"; } string IdFB = PostRow.IdFB; string Image = PostRow.Image; string url = "Guest/GhepDoiTinhDuyenListener/submit2?IdPost=" + IdPost; // string url = "http://localhost:3104/Guest/GhepDoiTinhDuyenListener/submit2/?id=" + IdFB + "&birthday=" + birthday + "&gender=" + gender; ViewBag.IdFB = IdFB; ViewBag.Image = Image; ViewBag.Gender = gender; ViewBag.IdPost = IdPost; ViewBag.Birthday = birthday; ViewBag.Url = url; return(View()); }