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."; } }

Voting Page
@if (result != "") {

Result: @result

}

--------------------------------------------------------------------------------------

Desired outputs:

Before user votes:

Given the following code in ASP.NET C#, feel free to make the

After user click vote button:

necessary changes(if not, you can implement your own codes) so that it

After user clicks Display button:(after multiple votes)

will display the output shown below. User can choose one of the

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!