Question: Given the following code in ASP.NET C#, feel free to make the necessary changes(if not, you can implement your own codes) so that it will
Given the following code in ASP.NET C#, feel free to make the necessary changes(if not, you can implement your own codes) so that it will display the output shown below. User can choose one of the options from the dropdown list to vote. The display button will show the votes for each person as well as the total votes.
You must use one text file to store and retrieve the records.
Every time the user votes, the vote counts inside the txt file will keep incrementing. It will not reset.
Below are the codes: (UserData.cshtml)
@{ var result = ""; if (IsPost) {
var dataFile = Server.MapPath("~/App_Data/data.txt"); result = "You have voted."; } }
--------------------------------------------------------------------------------------
Desired outputs:
Before user votes:

After user click vote button:

After user clicks Display button:(after multiple votes)

choose one to vote: John Vote Display choose one to vote: John Vote Display Result: You have voted. choose one to vote: John Vote Display John: 3 votes Linda: 5 votes George: 2 votes Total: 10 votes
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
