Improvisation
Improvising the previous code
let us do the below improvisations, now that we have understood the basics
Code behind
using Microsoft.AspNetCore.Mvc.RazorPages;
using Microsoft.AspNetCore.Mvc;
public class IndexModel : PageModel
{
[BindProperty]
public int FirstNum { get; set; }
[BindProperty]
public int SecondNum { get; set; }
public int Result { get; set; }
public void OnGet(){ }
public void OnPost()
{
Result = FirstNum + SecondNum;
}
}Mark up
Last updated