title: HTMLEncode/HTMLDecode and the apostrophe ASP.net
body: <p>I have text box that allows the user to enter something which is stored in the database, and then another text box which retrieves this value from the database and displays it. Currently, I have something like this:</p>
  
  <pre><code> string text = Server.HTMLDecode(userEnteredText);
   //code to put this text into the database
  
   Textbox1.Text = Server.HTMLDecode(textFromDatabase);
  </code></pre>
  
  <p>The Server.HTMLDecode solves any problems encountered if a user enters the ' char.</p>
  
  <p>However, I noticed if a user enters "&amp;#39" into the textbox, then ASP gives a error again thinking the client is entering potentially dangerous text. Is there anyway around this? I notice on most sites that this is automatically turned into a apostrophe. Any idea how I do this to avoid user input problems?</p>