Click here to Skip to main content
15,901,666 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
C#
public ActionResult Create(ded_table ded_table, login_user luser)
       {

           if (ModelState.IsValid)
           {
               var str = (from li in db.login_user

                          where li.EmpId == luser.EmpId
                          select new
                          {
                              id = li.EmpId,
                          }).ToArray();

               return Json(str);

               db.ded_table.AddObject(ded_table);
               db.SaveChanges();
               return RedirectToAction("Index");
           }

i am not geting the luser.Empid
Posted

1 solution

Hi,

Please check the Iuser value from where you calling this method. and please not that in you method below code will never execute.

C#
return Json(str);//After this line no code will be executed.
db.ded_table.AddObject(ded_table);
db.SaveChanges();
return RedirectToAction("Index");


This may help you.
 
Share this answer
 
v2

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