Click here to Skip to main content
15,884,298 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
HTML
public ViewResult Index()
        {
            var ded_table = db.ded_table.Include("login_user");
            return View(ded_table.ToList());
        }  

[HttpPost]
        public ActionResult Create(ded_table ded_table)
        {
            if (ModelState.IsValid)
            {
                db.ded_table.AddObject(ded_table);
                db.SaveChanges();
                return RedirectToAction("Index");  
            }

            ViewBag.ded_emp_id = new SelectList(db.login_user, "EmpId", "FirstName", ded_table.ded_emp_id);
            return View(ded_table);
        }

login_user is table in this EmpId is one of the field.
Posted
Updated 25-Sep-12 1:09am
v2
Comments
Zoltán Zörgő 25-Sep-12 7:15am    
Make a linq filter over the db.login_user.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900