Getting nothing while parsing XML response from the .aspx page of VS 2005 in JQuery
<p>I am not able to get xml response data from .aspx page of VS 2005. Following is the function which writes xml response on the client end:</p>

<p>protected void GetMailContents(double pdblMessageID)
    {
        string lstrMailContents = "";
        DataSet lobjDs = new DataSet();
        StringBuilder stringBuilder = new StringBuilder("");</p>

<pre><code>    lobjDs = mobjCProfileAndMail.GetMailContents(pdblMessageID);

    if (lobjDs != null)
    {
         stringBuilder.Append("&lt;Contents&gt;&lt;From&gt;");
         stringBuilder.Append(lobjDs.Tables[0].Rows[0]["From"].ToString());
         stringBuilder.Append("&lt;/From&gt;&lt;To&gt;");
         stringBuilder.Append(lobjDs.Tables[0].Rows[0]["To"].ToString());
         stringBuilder.Append("&lt;/To&gt;&lt;Subject&gt;");
         stringBuilder.Append(lobjDs.Tables[0].Rows[0]["Subject"].ToString());
         stringBuilder.Append("&lt;/Subject&gt;&lt;Message&gt;");
         stringBuilder.Append(lobjDs.Tables[0].Rows[0]["Message"].ToString());
         stringBuilder.Append("&lt;/Message&gt;&lt;/Contents&gt;");
    }

    stringBuilder.Append("&lt;/MailContents&gt;");

    lstrMailContents = "&lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt; \n ";
    lstrMailContents += stringBuilder.ToString();
    Response.ContentEncoding = Encoding.UTF8;
    Response.Write(lstrMailContents);
    Response.End();
}
</code></pre>

<p><strong>Code on the client end:</strong></p>

<pre><code>    $(document).ready(function()
    {
        var varURL = document.URL;
        var varArr = varURL.split('=');
        var varMessageID = varArr[1];

        $.get("AjaxData.aspx?Mode=MODALDIALOG."+varMessageID, function(data)
        {
              $(data).find('Contents').each(function()
              {  
                 var varFrom = $(this).find('From').text();  
                 var varTo = $(this).find('To').text();  
                 var varSubject = $(this).find('Subject').text();
                 var varMessage = $(this).find('Message').text(); 
                 alert(varFrom);
             });  

        });
    });
</code></pre>

<p>I have written a alert for the data coming from the callback but getting nothing. If I am parsing any fixed xml then its working fine but in case getting response from the .aspx page got nothing. Is there any one who can help me out for this problem.</p>

<p>Thanks.</p>
