The app does not allow edits to the pre-existing card view contents
I have a simple webapp as per screenshot; the app loads the data from my MariaDB and displays it in the form of the card view (Property Name: asere). You can see the bottom edit button in there too. The problem is that the Edit button does not let me edit anything on this card view. The debug shows what happens in the backend as follows
public JsonResult EditUserJ(int Id) //For getting details of the selected User { //EditUserJ is set to 200 (ok) on devtool however the response is null as the id is set to the wrong index try { var User = _context.ListingDTO_DBTable.Find(Id); //somehow it is set to Id = 0 !! wrong. if (User != null) { Console.WriteLine($"Got it"); return Json(User); } return Json(null); //My MariaDB Datatable has no entry with the Id 0, so it simply returns null } catch (Exception ex) { return null; } }
public JsonResult EditUserJ(int Id) //For getting details of the selected User { //EditUserJ is set to 200 (ok) on devtool however the response is null as the id is set to the wrong index try { var User = _context.ListingDTO_DBTable.Find(Id); //somehow it is set to Id = 0 !! wrong. if (User != null) { Console.WriteLine($"Got it"); return Json(User); } return Json(null); //My MariaDB Datatable has no entry with the Id 0, so it simply returns null } catch (Exception ex) { return null; } }
` My Datatable only has this entry with Id = 3 as per datatable below. Does anyone have any idea why my controller (EditUserJ) accesses the Id = 0 instead of the pre-existing Id 3?? I guess this wrong access caused my Edit button to be not functional as I wanted.