Академический Документы
Профессиональный Документы
Культура Документы
View
@{
ViewData["Title"] = "Home Page";
}
<form asp-action="index">
<div class="text-center">
<h1 class="display-4">Welcome to Calculator</h1>
<p><input type="number" placeholder="Enter First Value"name="firstvalue"
required></p>
<input type="number" placeholder="Enter Second Value"name="Secondvalue"
required></p>
<input type="submit" name="Cal" value="Add" class="btn btn-primary" />
<input type="submit" name="Cal" value="Sub" class="btn btn-primary" />
<input type="submit" name="Cal" value="Mul" class="btn btn-primary" />
<input type="submit" name="Cal" value="Div" class="btn btn-primary" />
<input type="submit" name="Cal" value="Remainder" class="btn btn-primary" />
</p>
Result<input type="number" value="@ViewBag.result" />
</p>
</div>
</form>
CONTROLLER
namespace calculator.Controllers
{
public class HomeController : Controller
{
private readonly ILogger<HomeController> _logger;