Returning Html To XMLHttpRequest Object
<p>I am making an ajax call to a service that returns html as a string with this code..</p>

<pre><code>var xhReq = new XMLHttpRequest();
xhReq.open("POST", "MobileClientService.svc/REST/TestHtmlSend", false);
xhReq.send(null);
xhReq.responseType = "text/html";
var serverResponse = xhReq.responseText;
alert(serverResponse); // Shows "15"
</code></pre>

<p>The service creates the html correctly..</p>

<pre><code>&lt;div data-bb-type="item" data-bb-img="Images/imagesBBUI/icons/icon11.png" data-bb-title="Title From Server"&gt;

&lt;/div&gt;
</code></pre>

<p>The problem is "serverResponse" in my code is returning this..</p>

<pre><code>&lt;div data-bb-type=\"item\" data-bb-img=\"Images/imagesBBUI/icons/icon11.png\" data-bb-title=\"Title From Server\"&gt;
  \u000d\u000a\u000d\u000a
&lt;\/div&gt;
</code></pre>

<p>Here is the C# code used to create the html..</p>

<pre><code>  public string TestHtmlSend()
        {
            string moomoo = String.Empty;

            // Initialize StringWriter instance.
            StringWriter stringWriter = new StringWriter();

            // Put HtmlTextWriter in using block because it needs to call Dispose.
            using (HtmlTextWriter writer = new HtmlTextWriter(stringWriter))
            {
                //start collapse div
                writer.AddAttribute("data-bb-type", "item");
                writer.AddAttribute("data-bb-img", "Images/imagesBBUI/icons/icon11.png");
                writer.AddAttribute("data-bb-title", "Title From Server");
                writer.RenderBeginTag(HtmlTextWriterTag.Div);
                //writer.Write("Some Whatever Description");
                writer.RenderEndTag();

            }

            moomoo = stringWriter.ToString();
</code></pre>

<p>How do I change my code to return the html as it is without all the extra "\"?</p>
