public ActionResult Submit(string name)
 {
     var data = new Data();
     data.Name = name;
     data.Self = data;
     TempData["data"] = data;
     return RedirectToAction("Index");
 }
        public ActionResult Index(string name, string username)
        {
            if (String.IsNullOrWhiteSpace(name))
            {
                ModelState.AddModelError("name", "Name was required.");
                TempData["error"] = ModelState;
                return RedirectToAction("Error");
            }

            var data = new Data();
            data.Name = name;
            data.Self = data;
            TempData["data"] = data;

            if (username != null)
            {
                FormsAuthentication.SetAuthCookie(username, false);
            }

            return RedirectToAction("Index");
        }