Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 22nd, 2012  |  syntax: None  |  size: 0.45 KB  |  hits: 14  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. How to allow a user to enter html comments
  2. <b>text</b>
  3.        
  4. [ValidateInput(false)]
  5. public ActionResult foo()
  6. {
  7. }
  8.        
  9. public class Foo
  10.     {
  11.         [AllowHtml]
  12.         public string bar{ get; set; }
  13.     }
  14.        
  15. </system.web>
  16.   <httpRuntime requestValidationMode="2.0" />
  17. </system.web>
  18.        
  19. public class MyModel
  20. {
  21.     public MyModel()
  22.     {
  23.  
  24.     }
  25.  
  26.     // Some other stuff in here
  27.  
  28.     [AllowHtml]
  29.     [HttpPost]
  30.     public string MyHtmlString { get; set; }
  31.  
  32. }