ASP.NET multiline textbox issue with javascript and AJAX (Jquery)
<p>In my web application I have a textbox called "Address" which is multiline and have 3 rows and 250 characters.</p>

<p>I am calling a javascript function in which i am calling AJAX to send the data to a webservice for some processing but AJAX is unable to process variable which contains multiline text.</p>

<p>I am reading multiline textbox value like this in javascript function.</p>

<pre><code>var puid = document.getElementById('&lt;%=userid.ClientID%&gt;').value;
var paddress = document.getElementById('&lt;%=xaddress.ClientID%&gt;').value;
</code></pre>

<p>and passing like this.</p>

<pre><code>$.ajax({
    type: "POST",
    url : "DataService.asmx/UpdateProfile",
    data: "{'puserid': ' " + puid +   'padd': ' " + paddress +  " '}",
    contentType: "application/json; charset=utf-8",
    dataType: "json",
    success: OnSuccess,
    error: OnError
});
</code></pre>

<p>If I comment paddress parameters in ajax "data:" it works fine other wise ajax goes on "OnError" ...Oh i just figured out that my address has <strong>'B' Area</strong> (apostrophe) in it thats why it its giving this problem. So how to parse apostrophe as textbox value and read in javascript variable and write back in database similary.</p>
