You may not realize it, but the question you asked basically amounts to "how do I create a website?" And the only constraint you've specified is that you want to (somehow) use C# to do it.
Now, you might be thinking that you also have another major constraint:
[...] instead of creating it page by page, I want to have one "code" that will show all of the pages, depending on the exact url requested.
But if you think about it a little bit, that's actually how all web sites work. At some level, there's always a single server program that accepts HTTP(S) requests for different URLs and responds to them with some content. Now, in many cases that server might actually be configured to pass different URLs off to different subprograms, or to just read the content for each URL from a specific file. But it can also be (and often is) configured to pass all the URLs matching some pattern to the same subprogram. Or the server might simply be something like a node.js process that handles all the URLs directly, without delegating them to any other code.
So basically, you're asking how to make a website in C#. With the only restriction being that you don't want to have a separate C# program for each page, which really doesn't limit the solutions much, if at all. (Honestly, having a separate C# program for each page would be kind of a silly way to make a website, anyway.) I think you might now see why some would consider your question too broad to be usefully answered on SO.
Now, in your comments here, you've narrowed down your problem a bit more. Specifically, you've told us that:
- you already have an existing website (presumably consisting of static HTML pages served by something like Apache or IIS) hosted somewhere, and you want the new site to be on the same host;
- your webhost supports ASP.NET MVC, ASP.NET Core and WebForms; and
- the content you want to serve comes from a (SQL?) database, and you already have some reasonable way of populating and updating the database as needed.
That already narrows your question down quite a bit, although I'm still not quite sure that it's quite specific enough for SO. Remember that people here can't see your database or read your mind, so you do need to spell out everything that might be relevant in your question. In particular, I'd like to see at least the following information in any followup question you may ask:
- What kind of content does your database contain? Is it pre-made HTML that you just need to return to the browser (maybe with some simple fixed wrapper around it), or do you need to process the data in some way to actually turn it into an HTML page?
- What kind of a database is your content stored in?
- Which web server software is your webhost running?
- How is your existing site structured, and how do you plan the new pages to fit in? Will all the URLs for the new pages e.g. begin the same way?
Also, for the reasons already describe in the other meta answers here, you probably should narrow your question down to one specific technology.
If necessary, you can ask multiple versions of the same question for different platforms. If you do that, don't ask them all at the same time, and preferably link back from the later ones to the earlier ones. Also, make the difference between the questions, and your reasons for asking them all (i.e. that you want to compare the solutions in the different frameworks before choosing one), really clear.
That said, it might be better to first decide which platform you want to go with, then look around to see if you can figure how to solve your task yourself using the framework you've chosen, and only resort to asking on SO if you're still stuck. Unfortunately, SO itself is not well suited for questions like "which platform should I choose for this project?", although you might be able to get some helpful suggestions e.g. on SO chat.