HttpRequestValidationException in Request.Form
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
Code
| <httpRuntime requestValidationMode="2.0" /> | |
|     <pages  validateRequest="false"> | 
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!
Entity Framework sounds better than LINQ to SQL
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.
JSON in WCF
A lot of people know about WCF supports XML as the return response. Actually, it supports JSON. All you need to set ResponseFormat. 
Code
| [WebGet(ResponseFormat=WebMessageFormat.Json)] | |
| [OperationContract] | |
| public SessionKeyDTO Authenicate(string username, string password) | 
And you need to set web.config
Code
| <behavior name="AdvCMS.Services.Service2AspNetAjaxBehavior"> | |
| <webHttp/> | |
| <enableWebScript /> | |
| </behavior> | 
It needs <webhttp/>. That is easy!
The code is a part of our CMS, AdvGenCMS.
Our .Net 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.
MVC 3 Example
I have completed the users section for AdvGenCMS. I used ASP.Net MVC 3 and Razor to do. It has CRUD functions and used the LINQ Repository Pattern. I think that is a good example for MVC3 in C#.
Please download the source and check it out http://localhost:44271/Account/List page in your own development box.



