This commit is contained in:
mmrbnjd
2024-09-12 23:17:21 +03:30
parent b1cd733ac5
commit b2030c8a3b
8 changed files with 26 additions and 26 deletions

View File

@@ -30,28 +30,24 @@
</div> </div>
<br /> <br />
<div class="container"> @if (request!=null)
<nav aria-label="Page navigation"> {
<ul class="pagination justify-content-center"> <div class="container">
@for (int page = 1; page <= request?.PageCount; page++)
{
if (page == PageIndex)
{
<li class="page-item disabled">
<a class="page-link" href="@Navigation.GetUriWithQueryParameter("PageIndex",page)">@(page)</a>
</li>
}
else
{
<li class="page-item">
<a class="page-link" href="@Navigation.GetUriWithQueryParameter("PageIndex",page)">@(page)</a>
</li>
}
}
</ul> <Pagination TotalPages=@request.PageCount
</nav> ActivePageNumber="@PageIndex"
</div> PageChanged="OnPageChangedAsync"
Alignment="Alignment.Center"
FirstLinkIcon="IconName.ChevronDoubleRight"
PreviousLinkIcon="IconName.ChevronRight"
NextLinkIcon="IconName.ChevronLeft"
LastLinkIcon="IconName. ChevronDoubleLeft" />
</div>
}
</div> </div>
@code { @code {
@@ -59,12 +55,16 @@
public int PageIndex { get; set; } public int PageIndex { get; set; }
public Shared.DTOs.PagingDto<QuestionDto>? request { get; set; } public Shared.DTOs.PagingDto<QuestionDto>? request { get; set; }
private async Task OnPageChangedAsync(int newPageNumber)
{
request = await _hc.GetFromJsonAsync<PagingDto<QuestionDto>>($"Base/LastQuestion?PageIndex={newPageNumber}&PageSize=5");
await Task.Run(() => { PageIndex = newPageNumber; });
}
protected override async Task OnParametersSetAsync() protected override async Task OnParametersSetAsync()
{ {
request = await _hc.GetFromJsonAsync<PagingDto<QuestionDto>>($"Base/LastQuestion?PageIndex={PageIndex}&PageSize=10"); request = await _hc.GetFromJsonAsync<PagingDto<QuestionDto>>($"Base/LastQuestion?PageIndex={PageIndex}&PageSize=5");
await base.OnParametersSetAsync(); await base.OnParametersSetAsync();
} }
} }

View File

@@ -48,7 +48,7 @@
<div class="row"> <div class="row">
<div class="col-xl-12"> <div class="col-xl-12">
<div class="blog-details-big-img z-index-2"> <div class="blog-details-big-img z-index-2">
<img src="img/blog/@Item?.Photo" alt=""> <img src="img/blog/@Item?.Photo" width="400" height="400" alt="">
</div> </div>
</div> </div>
</div> </div>

View File

@@ -36,10 +36,10 @@ builder.Services.AddScoped(sp => new UserAuthenticationDTO()
//builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri("http://195.88.208.142:7075/api/") }); //builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri("http://195.88.208.142:7075/api/") });
//Home //Home
//builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri("https://localhost:7075/api/") }); builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri("https://localhost:7075/api/") });
//farzan //farzan
builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri("http://localhost:5271/api/") }); //builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri("http://localhost:5271/api/") });
CultureInfo.DefaultThreadCurrentCulture = new CultureInfo("fa-Ir"); CultureInfo.DefaultThreadCurrentCulture = new CultureInfo("fa-Ir");

Binary file not shown.

After

Width:  |  Height:  |  Size: 253 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 369 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 286 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 298 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 266 KiB