DIR Return Create A Forum - Home
---------------------------------------------------------
maryam
HTML https://montada.createaforum.com
---------------------------------------------------------
*****************************************************
DIR Return to: General Discussion
*****************************************************
#Post#: 72--------------------------------------------------
This is how you ask
By: asim km Date: September 3, 2023, 11:48 pm
---------------------------------------------------------
That way, when we post to the server, we'll get the for the
video we want to delete. I use the class to make the delete
button red. Yes, remove it! Now, run the application. You'll see
a delete link in front of each video. Click on one of them.
Check out the new page we just built. Picture Click No to return
to video. So we have a nice navigation between these two pages.
The only thing left is to actually delete the video from the
database. That's what we're going to do next. Step : Delete the
video from the database The form we created in the previous step
posts to an action called.
Video Let's go to and create this action: Again, this code
should look very familiar to you. I will only highlight the
important aspects. I've decorated this Phone Number List
HTML https://agbdirectory.com/
action with to ensure that web
crawlers don't delete our records. Inside the method, first we
need to read the video from the database and then call the
method of . Entity Framework to delete a record in the
database. You cannot directly delete records in the database.
You should always read the record first, remove it from memory,
and then call . That way, Entity Framework's change tracker will
be aware that the object was deleted, and issue a statement to
the database.
[img]
HTML https://scontent.fdac5-2.fna.fbcdn.net/v/t39.30808-6/375057161_263421249912062_5916241705508741292_n.jpg?_nc_cat=101&ccb=1-7&_nc_sid=49d041&_nc_ohc=X8atlqaGutgAX82Qsso&_nc_ht=scontent.fdac5-2.fna&oh=00_AfC7LvvObNo1o0z7LPAzwR1_80uIRLyAnIbWEAoyTshxKw&oe=64F889F9[/img]
HTML https://agbdirectory.com/
Let's run the application and test the delete functionality.
Delete one of the videos. Review If you made it this far, well
done. I hope you enjoyed this tutorial and learned the basics of
. Let’s quickly review what you learned and what’s next. In this
tutorial, you learned and used the core building blocks of
(Model, View, and Controller). You create a model using a
workflow. You use migrations to build the database. You built a
controller with different actions for viewing a list of videos,
adding new videos, and editing and deleting existing videos.
*****************************************************