Please see my comment to the question.
Based on my reasoning, I cannot believe that answering your question could really help you. If you had your own interesting ideas of some CMS, especially some very compact one, and could create some prototype of it, it would be the totally different story, but then you would not ask this question. This way, I tend to come to the conclusion that you have to learn what existing CMS do (before you even think how they operate or can be implemented), and, first of all, consider using of one of such available systems. Later on, you could come to understanding of how they work and probably think at the possibility to develop something on your own. But it would makes sense if you have more productive and interesting ideas compared to the well-known and implemented ones.
Please see:
Content management system — Wikipedia, the free encyclopedia[
^],
List of content management systems — Wikipedia, the free encyclopedia[
^].
Sorry for not answering your question exactly as you formulate it, but it's not clear what kind of help would you expect. If you really mentioned to develop the functionality which can be used to "make changes inside an ASPX page and adding files and folders", it's hard for me to imagine what prevents you from developing the functionality which can be used to "create pages and master pages and config files". That's why we have the section of the question titled "What I have tried". Perhaps you need
to understand what it means.
—SA