Welcome to the FoxLearn
Today we will learn how to create a feedback form
First, You need to download Elegant Feedback Form Flat Responsive Widget Template, then unzip and copy to the MVC Demo Project
You need to create a feedback class with the corresponding fields in your template
You can create an answer class to store your answers
You can create a FeedbackViewModel class to transfer data between view and controller
You need to add a feedback property to application db context class
then run add-migration command to create the feedback table
We will create a feedback controller, then add a create action to the feedback controller
You need to create actions with httpget and httppost to create method
Right click on action, then add view to create action
Copy your template to create view, then change path of css and javascript in create view
You can create a common class to initialize your answers
Now, We will add code to the create view allows you to get and post data
We will use the select property to get answer ID selected from radio
You need to create an instance to application db context
then add code to save feedback data to your database
You should create an index view, by right click on index action, then add view to the index action
To play the demo, you should create an action link to index method of the feedback controller
Thank you for watching this video