Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

asp.net core mvc razor page call pagemodel actio

// Backend:
public IActionResult OnGetSellProduct(int id)
{
    var products = _context.Products;

    _context.Products.Find(id).SubtractProduct();
    return Page();
}

<!-- FrontEnd: -->
<a asp-page-handler="SellProduct" asp-route-id="@item.ProductId">Sell Product</a>
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #core #mvc #razor #page #call #pagemodel #actio
ADD COMMENT
Topic
Name
5+4 =