Creating a Web Form

Open and redact the file Views/Home/Index.cshtml. Delete everything and insert the following code:

This code creates a web form <form> with a field "rating" for inputting a number in the interval [0 … 100] and a button [Draw] to send data from the form to the server. The action which will process the data is called /Home/DrawRatings, which means method DrawRatings in controller Home, which is in the file HomeController.cs. After the form the contents of ViewBag.Stars are printed. The code, which will be inside, will be dynamically generated by the HTML controller with a series of stars.

results matching ""

    No results matching ""