TipCalculator
@{
ViewData["Title"] = "Tip Calculator";
}
<div asp-validation-summary=All></div>
<form asp-action = "Index" method="post">
<div>
<label>Cost of Meal:
<input asp-for="MealCost"/>
</label>
</div>
<div>
<label>15% tip:</label>
<label>@ViewBag:Fifteen.ToString("c2")</label>
</div>
<div>
<label>20% tip:</label>
<label>@ViewBag:Twenty.ToString("c2")</label>
</div>
<div>
<label>25% tip:</label>
<label>@ViewBag:TwentyFive.ToString("c2")</label>
</div>
<div>
<button type="submit">Calculate</button>
<a asp-action="Index">Clear</a>
</div>
</form>
Are you sure you need “:” there and not “.”?
Обсуждают сегодня