asp.net core razor OnGet 异步写法

浪淘沙8个月前后端222
public async Task<IActionResult> OnGetAsync()
{
    var data = await _service.GetListAsync(); // 异步数据库/接口
    List = data;

    return Page();
}


相关文章

asp.net core rzaor page 中的ViewComponent 视图用法

asp.net core rzaor page 中的ViewComponent 视图用法

1、/Pages/Components 新建:MyViewComponent.csusing Microsoft.AspNetCore.Mvc; namespace xxts...

asp.net core [BindProperty] 用法

在 ASP.NET Core 中,[BindProperty] 是一种用于绑定模型属性的特性,通常与 Razor 页面配合使用。它会自动将请求中的表单数据绑定到页面模型的属性上,简化了手动从 Requ...

ckeditor编辑器

@page @model xxtsoft.Web.Entry.Pages.Index2Model @{ } <script src="~/ckeditor/...

json解析

{   "accessToken": "xxxxxx",   "refreshToken&quo...

发表评论    

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。