Avatar of flynny
flynny
Flag 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.
C#jQueryAJAX

Avatar of undefined
Last Comment
Aaron Jabamani

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Aaron Jabamani

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy