public ActionResult Create([Bind(Include = "ID,fname,lname,gender,age")] Membership membership)
        {
            if (ModelState.IsValid)
            {
                db.Members.Add(membership);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(membership));
        }
Ejemplo n.º 2
0
        public ActionResult Create([Bind(Include = "MemberID,UserName,DisplayName,DateJoined,LastLogin,ProfileID")] Member member)
        {
            if (ModelState.IsValid)
            {
                db.MyMember.Add(member);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.MemberID = new SelectList(db.Profiles, "ProfileID", "ProfileID", member.MemberID);
            return(View(member));
        }