title: Best Way to Prevent SQL Injection Using Javascript or C#?
body: <p>I'm currently writing an application which uses ajax on the front end and ASP.NET (C#) on the back end..</p>
  
  <p>A Small Part of the application does an AJAX call to the backend code (to get entries from the SQL database)</p>
  
  <p>How can i prevent SQL of JScript injection?</p>
  
  <p>I know it is generally unsecure to validate with javascript because javascript can be turned off but as this is an AJAX call so if the user has javascript turned off the AJAX will never run.</p>
  
  <p>Whats the best way of validating or escaping the input?</p>
  
  <p>Like Add_Slashes() in PHP?</p>
  
  <p>Thanks </p>
  
  <p>Daniel</p>