title: remove html tags or script tags in c# string and also in client using javascript
body: <p>I need to do a user input validation, and I want it validated both in the client side and in the server side.
  I have ang textbox that the user can write his comment on the product, now what I wanted to do is to validate if his comment doesn't have any injections like html or javascripts. So what I wanted to do, after the user clicks on submit</p>
  
  <p>1.) Client Side: How will I execute a validation like if the user inputs this kinds of string </p>
  
  <pre><code>&lt;a href=""&gt;abcd&lt;/a&gt; // I will accept only abcd and remove the anchor tag but the abcd should appear as a link
  &lt;script type="text/javascript"&gt;alert(123);&lt;/script&gt; // I will accept only alert(123);as the valid string
  &lt;b&gt;abcd&lt;/b&gt; // I will display abcd but it must appear bold
  </code></pre>
  
  <p>2.) Server side: Same situation with the client side, I will remove the tags of the injected script and html tags. 
  I am using sharepoint 2007, I'm not sure if there is a built-in function to do this kind of validation in sharepoint api or c# for the server side validation.</p>
  
  <p>Note: I don't want to use RegEx for this or any third party software. I know many experts here can help me with this. Thank you so much!</p>