Posted on: 5/7/2014 5:44:50 AM | Views : 358

Where is the best place to sanitize? I was thinking about doing the following but someone may have a better idea
public class myObject { [Required] public string SomeTextField {get; set;} public string SomeTextFieldSanitized { get { return Sanitizer.GetSafeHtmlFragment(SomeTextField); } } [Required] public string SomeOtherTextField {get; set;} public string SomeOtherTextFieldSanitized { get { return Sanitizer.GetSafeHtmlFragment(SomeOtherTextField); } } } This way, I can just work with properties that have the "Sanitized" in their names.
Is there a better way to handle this?

Go to the complete details ...