Add/Edit Clear State

2 posts, 0 answers
  1. Robert
    Robert avatar
    9 posts
    Member since:
    May 2011

    Posted 10 Sep 2012 Link to this post

    Hi have implemented a Grid using Open Access as the ORM.

    The data displays fine as does completing updates. However if you add an item and save it, then every subsequent edit on existing items creates a new entry as each edit is behaving as a newly added Item.

    The only way to stop this is to manually refresh the page.

    Rob
  2. Robert
    Robert avatar
    9 posts
    Member since:
    May 2011

    Posted 12 Sep 2012 Link to this post

    Problem solved 

    When creating an new item you should return a collection with the updated record with the ID set 
    from the action so that the DataSource can know that the item is successfully created and it can be distinguished from the new items e.g.


    return Json(new [] { pmgToCreate }.ToDataSourceResult(request, ModelState));
  3. UI for ASP.NET MVC is VS 2017 Ready
Back to Top