Does this make sense? |
So I wanted to add a delete button which will delete the card div from my MVC view as per attached screenshot. Gemini suggested that a dedicated method shall be added to the controller class (to just delete the card view). It also suggested that I would add the button part in the view like this
For your reference more codes are here https://pastebin.com/anCaF4X3
Could you kindly point me in the right direction? I am not sure if Gemini suggested an optimal way to achieve what I wanted.
Pastebin
/Controller Class/using System.Diagnostics;using Microsoft.AspNet...
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
3 Replies
LLMs being LLMs and producing nonsensical code, more news at 11
Ok so it does not make sense then. I do not ask for the solution code or anything but I would like some advice on how to approach it: I googled how to delete the card view with the button Onclick: I only found the frontend ways like manipulating jquery to make the div items disappear (that div has no text data retrieved/loaded from SQL). If the div card item displays data loaded from SQL, does it still make sense to remove it via jquery etc? Or would you do that very differently?
Well, if you want to delete this item without reloading the page, then yes, JS is the only way you can achieve that
If a reload is fine, then creating a link to some
/delete
action and deleting the item there is fine as well