title: Display Friendly Error Message When Html tag is entered in a text Box- MVC ASP.NET
body: <p>I have requirement of validating user input in a text box. Whenever a html tag is entered it should display the same view with friendly error message like "Cannot enter html tags."</p>
  
  <p>The ways I have tried so far are:</p>
  
  <ol>
  <li>[ValidateInput(true)] on the Controller- It comes up with error "Potentially dangerous request"</li>
  <li>[ValidateInput(false)] on the Controller- It stores the value in the database-(I don't want this)</li>
  <li>In the view Model I placed a tag for the property <code>[RegularExpression ( "&lt;([A-Z][A-Z0-9]*)\b[^&gt;]*&gt;(.*?)&lt;/\1&gt;",ErrorMessage = "You have entered html…Html is not a valid input!" )]</code></li>
  </ol>
  
  <p>any one had this this issue. If yes please let me know, how have you fixed that.</p>
  
  <p>Thank you</p>