• Guest, before posting your code please take these rules into consideration:
    • It is required to use our BBCode feature to display your code. While within the editor click < / > or >_ and place your code within the BB Code prompt. This helps others with finding a solution by making it easier to read and easier to copy.
    • Don't share a wall of code. All we want is the problem area, the code related to your issue.


    To learn more about how to use our BBCode feature, please click here.

    Thank you, Code Forum.

C# How to build 'update' method for Kendo UI jQuery Grid

feffernoogan

New Coder
Hello, I have completed this tutorial online: Get Started with ASP.NET Core MVC https://learn.microsoft.com/en-us/a...rt-mvc?view=aspnetcore-6.0&tabs=visual-studio
I have also converted the movie database to display as a grid using Kendo UI jQuery. The movies displays how they are supposed to, but now I want to add additional features such as updating, destroying, and creating. So far, I have updated my Index.cshtml file to reflect the proper 'transpose' criteria. However, I am having trouble creating the 'update' method in the controller. Is someone able to provide some assistance with this? Any help is much appreciated.

Here is my code so far from the 'Movies_Read' method and the 'Movies_Update' method (the second one I have trouble with):

C#:
     public async Task<IActionResult> Movies_Read(DataSourceRequest request)
        {
            var movies = _context.Movie.ToList();

            DataSourceResult result = new DataSourceResult();
            result.Data = movies.AsQueryable();
            result.Total = movies.Count;
            
            return Json(new
            {
                data = result,
            });
        }

        // POST: Movies_Update
        [HttpPost] // All the methods that create, edit, delete, or otherwise modify data do so in the[HttpPost] overload of the method
        public async Task<IActionResult> Movies_Update([DataSourceRequest] DataSourceRequest request, Movie movie)
        {

        }

 
Top