I am building an installer for my CMS, AdvGenCMS. The first part is adding connection string and saves it into web.config. That is doable in C#. Just like the following code:
We can use WebConfigurationManager.OpenWebConfiguration("~") to get the whole configuration and then use config.GetSection("connectionStrings") to get the connection string section. Now, we can play around the connection string section freely.
I am writing a CMS in C# and a html editor in the asp.net page. Therefore, I got some HTML code in Request.Form Object. Last night, I found the problem. I got HttpRequestValidationException when I save a html content. That is safe by rejecting any post variables has html code. So, I tried the used [ValidateInput(false)] in the controller, that is not working. Finally, I found I need to turn off that globally in web.config
Please remember to use <httpRuntime requestValidationMode="2.0" /> for switching the validation mode into 2.0, unless just turn off validate request is not enough!
Recently,I did some researches for Entity Framework and LINQ to SQL. I found Entity Framework sounds better. It got better facilities. It can generate data tables from EDX and if the tables can generate the updated classes from the database. If you are using LINQ to SQL, you need to update manually. Entity Framework sounds a more completed ORM, LINQ to SQL is only a tool to translate the objects into SQL. But I think LINQ to SQL is more lightweight.
A lot of people know about WCF supports XML as the return response. Actually, it supports JSON. All you need to set ResponseFormat.
And you need to set web.config
It needs <webhttp/>. That is easy!
The code is a part of our CMS, AdvGenCMS.
Recently, our Company(AdvanGeneration) have built a lightweight .Net CMS,AdvGenCMS. I did some researches for .Net CMS. The most of them have own their ORM and Dependency injection framework. That is very hard to adapt into a web development framework. Thus, we decided to build our own.
AdvGenCMS is very simple. Our ORM is ms entity framework. Moreover, we have not any dependency injection framework. Currently, it used a factory design pattern, but that can choose to add dependency injection framework on your choice. Lastly, it used ASP.Net MVC. All of them are very very standard Microsoft technologies.
I don't want to add any functions you don't need. I just needed the core functions. Our CMS should be as simple as possible.
It has a user management function:
Moreover, it has a page function. You can add the static content and access them via http://[server]/Content/[PageName]
Lastly, it uses tinymce to be a html editor.
Let's use AdvGenCMS to be your web development framework. It uses Apache License.