C
C#2y ago
2fur

❔ How to create a subpage by code

Hello, sorry for the dumb question, but its my first attempt to create a website. Is it possible to create/generate from template a subpage? I mean if i have e.g. https://mypage.com/home, i would like to create from it e.g. https://mypage.com/home/user1 / https://mypage.com/home/user2 and so on..
3 Replies
Kouhai
Kouhai2y ago
Yes, assuming your using MVC, you can render a page for user1 and user2 depending on the url
Angius
Angius2y ago
[HttpGet("[user]")]
public async IActionResult Index(string user)
{
// ...
}
[HttpGet("[user]")]
public async IActionResult Index(string user)
{
// ...
}
Route parameter binding
Accord
Accord2y ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server