Asp.mvc I can't delete an item
I can't seem to get this working as intended, it's not showing me the screen for deleting an item. Any fixes?
29 Replies
look at the URL you're going to and compare that to the routes you've defined
I just noticed the localhost change from 7043 to 7085. that's new
nah still doesn't work, same problem
the port isn't the problem
you're going to a route called Food/Edit, where is that defined in your code?
It said food update doesn't it?
no, it doesn't
I've just realised
wait hold on let me check smth, idk why it said food edit
okay that lead somewhere, though the delete still have the same problem
it's probably a similar issue
check your routes/verbs
i don't think so, I checked and it did said food/delete correctly
but are you sending a GET or a POST?
on update I sending aa put
delete i am sending a delete
I just changed it to post just in case but same problem
okay, so compare that to the routes you've defined in your code
that doesn't look like it says delete to me
I change it to delete and still same problem
what do your logs say
that doesn't show you making any of the requests that you're saying are broken
I didn't say it was broken
Yasaki Kondo
okay that lead somewhere, though the delete still have the same problem
Quoted by
<@901546879530172498> from #Asp.mvc I can't update or delete an item (click here)
React with ❌ to remove this embed.
look into making your logging more verbose so you can see what's going wrong
ok fix the update issue, it somehow didn't take in the ID of the item
had to add in first or default thingy
var foodItem = foodList?.FirstOrDefault(f => f.Id == ID);
still; haven't fix the delete problem tho
help I'm getting blind sighted, I can't seem to find where's the issue, it's still showing black screenhave you used your browser dev tools to see what the server is sending back?
I don't use browser dev tools...
you should, because that will help you diagnose the problem
right now I don't want to go through the hassle of installing a web browser dev kit for it
what?
just press f12
I though u need to install some kind of browser dev thingy
it shows this