Link to home
Start Free TrialLog in
Avatar of flynny
flynnyFlag for United Kingdom of Great Britain and Northern Ireland

asked on

using jqgrid with MVC 5 Controller

Hi All,

I'm trying to get jqgrid to working with a mvc controller.

However its not finding the controller method. Can anyone tell me why? I have the following code;

 jQuery("#jqgrid").jqGrid({
                    url: '@Url.Action("GetAdminUser", "User")',
                    editurl: '@Url.Action("EditAdminUser", "User")',
                    deleteurl: '@Url.Action("DeleteAdminUser","User")',
....

Open in new window


and in the controller

        [AcceptVerbs(HttpVerbs.Post)]
        public JsonResult GetAdminUser()
        {
            using (var dataContext = new DBDataContext())
            {
                var userRepository = new Repository<AdminUser>(dataContext);
                var allUsers = userRepository.GetAll().ToList();
                return Json(allUsers);
            }
        }

Open in new window


Thanks in advance,

Matt.
ASKER CERTIFIED SOLUTION
Avatar of Aaron Jabamani
Aaron Jabamani
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial