Finally, we built an installation program for AdvGenCMS. Now, you only need to open the solution and publish the AdvCMS folder. Then you create the database and assign a user with db_owner role. Finally, please run the website and fill in the details.
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.