0

I have three tables designation, department, employee.

When I go to create employee page,I need to pass designations and departmentsfor select input options in that page.

how can I pass those two models from asp.net controller as Jsonresult. I am using angularjs in client side.

Thanks in advance.

1 Answer 1

2
public JsonResult GetData()
{
   var departments = //fetch department list;
   var designations = //fetch designations;
   return Json(new { departmentList= departments, designationList= designations});
}

You can access these in your $http calls as result.designationList and result.departmentList

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.