@page
@model CalculatorWebApp.Pages.CalculatorModel
<h2>Calculator</h2>
<form method="post">
<div>
<label for="FirstNumber">First Number:</label>
<input type="text" id="FirstNumber" name="FirstNumber" />
</div>
<div>
<label for="SecondNumber">Second Number:</label>
<input type="text" id="SecondNumber" name="SecondNumber" />
</div>
<div>
<label for="Operator">Operator:</label>
<select id="Operator" name="Operator">
<option value="+">+</option>
<option value="-">-</option>
<option value="*">*</option>
<option value="/">/</option>
</select>
</div>
<div>
<input type="submit" value="Calculate" />
</div>
</form>
@if (Model.CalculationPerformed)
{
<div>
<h3>Result:</h3>
<p>@Model.Result</p>
</div>
}
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
namespace CalculatorWebApp.Pages