コード例 #1
0
        // GET: Contact/Create
        public ActionResult Create()
        {
            SelectList sexes = new SelectList(Sexes.Get());

            ViewBag.Sexes = sexes;

            return(View());
        }
コード例 #2
0
        // GET: Contact/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(HttpNotFound());
            }

            Models.Contact contact = _db.Get(id);

            if (contact == null)
            {
                return(HttpNotFound());
            }

            SelectList sexes = new SelectList(Sexes.Get());

            ViewBag.Sexes = sexes;

            return(View(contact));
        }