C#C
C#4y ago
M B V R K

Routing issue with ASP.Net Core

@AspNetCore @Web
Hi dear friends, I'm working on an
Asp.Net core 6
project.
inside a
Controller
called
Group
I have the following
ActionResult

    [Route( "/[area]/[controller]/Archive/Details/{id}" )]
    public async Task<IActionResult> ArchiveDetails(string id)
    {
        var obj            = await _mediator.Send( new GetGroupFromArchiveByIdQuery( id , includeDetails : true ) );
        var model          = _mapper.Map<GroupArchivedDetailsVm>( obj );
        var statisticsData = await _mediator.Send( new GroupGetStatisticsDataQuery( id ) );

        ( model.AbsencesCountGroupedByMonths , model.StudentsCountGroupedByGender ) = ( statisticsData.AbsencesCountGroupedByMonths , statisticsData.StudentsCountGroupedByGender );
        
        return View( model );
    }


I call this action from a view of another action called Archived, and the call syntax looks like the following
<li><a asp-action="ArchiveDetails" asp-route-id="@item.Id"><em class="icon ni ni-notes"></em><span>Details</span></a></li>


The issue:
When I clicked on
Details
button in Archived
view
the
id
looks like the break point representation screenshot attached with this question, but it should be without those % symbols like this G6-TGI - 2020/2021


Additional info:
The
coontroller
attributes I apply on it, looks like the following
[ExceptionHandlerFilter]

[Area( nameof(AppUserRole.Admin))]
[Route( "[area]/[controller]/{action=Index}" )]
[Authorize( Roles = nameof(AppUserRole.Admin))]
public class GroupController : Controller
{
...


Please how do I can fix this issue? and massive thanks in advance
unknown.png
Was this page helpful?