I am working in a project (RAZOR PAGES) and I am trying to make this URL pattern "/{clientName}/Forms/{page}"
acceptable to route. you should know I’m using Razor Pages NOT MVC.
clientName is any string
Forms is area
page is any page in Forms area
I did something similar in MVC but It didn’t work for me in this case;
I found this code
app.MapGet("/{clientName}/Forms/{page}", (string clientName, string page) =>
{
return Results.Ok($"cleintName: {clientName}, Page:{page}");
});
and it runs perfect but OnGet didn’t execute.
Now I want to get clientName
in OnGet
method ..
How can I do this?
what are the changes I should put in Program.cs