debut de travail sur la modification des utilisateurs

blazor
Patrick BRUGIERE 1 year ago
parent 2845856f51
commit a6130fe49e

@ -26,7 +26,7 @@ namespace adminBlazor.Pages
/// <summary> /// <summary>
/// The current item model /// The current item model
/// </summary> /// </summary>
private User user = new User() private Models.User user = new Models.User()
{ {
Roles = new List<string>() Roles = new List<string>()
}; };

@ -0,0 +1,6 @@
@page "/editUser/{Id:int}"
@using adminBlazor.Models
<h3>Edit</h3>
<div>My parameter: @Id</div>

@ -0,0 +1,11 @@
using Microsoft.AspNetCore.Components;
namespace adminBlazor.Pages
{
public partial class EditUser
{
[Parameter]
public int Id { get; set; }
}
}

@ -45,6 +45,12 @@
} }
} }
</DisplayTemplate> </DisplayTemplate>
</DataGridColumn>
<DataGridColumn TItem="User" Field="@nameof(User.Id)" Caption="Modifier">
<DisplayTemplate>
<a href="EditUser/@(context.Id)" class="btn btn-primary"><i class="fa fa-edit"></i> Editer</a>
</DisplayTemplate>
</DataGridColumn> </DataGridColumn>
</DataGrid> </DataGrid>

@ -0,0 +1,13 @@
@page "/RouteParameter/{text}"
<h1>Blazor is @Text!</h1>
@code {
[Parameter]
public string? Text { get; set; }
protected override void OnInitialized()
{
Text = Text ?? "fantastic";
}
}
Loading…
Cancel
Save