Thursday, July 12, 2018

MVC write code C#


@{
var totalMessage = "";
if(IsPost)
    {
    var num1 = Request["text1"];
    var num2 = Request["text2"];
    var total = num1.AsInt() + num2.AsInt();
    totalMessage = "Total = " + total;
}
}











@totalMessage


https://www.w3schools.com/asp/showfile_c.asp?filename=try_razor_cs_004

No comments: