I\'m building a Content Management System to allow people other than me to update stuff on the site.
I have a front-facing HTML form that sends data, via AJAX, to a
You should do it as-
Create a separate class with entities those are required-
public class EntityDto {
public String id { get; set; }
[AllowHtml]
public String HTML_Stuff { get; set; }
}
And then use it in your controller method-
[ValidateInput(false)]
public void UpdateCar(EntityDto model)
{
var html_stuff = model.HTML_Stuff;
// sanitation and validation
String Select = String.Format("UPDATE Car Set HTML_Stuff = {0} WHERE id = {1}", html_stuff , id);
// Execute DB Command
}
Let me know if it helps.