Ajax call cross domain asp.net webservice

Ajax call cross domain asp.net webservice

Hi everyone, 

I am recently experiencing a problem with .ajax calling cross domain asp.net webservice.
It started working fine, until the data returned from server is becoming too big and suddenly the ajax call caused errors, if i reduce the data length then the error went away.
After doing some debug, i have identified the problem being the callback was inserted into the returned data.
e.g, in the returned data, i got the following.
<div class="download);jsonp1274754505287("><div class="downloadBase"><div class="highlightedDiv">
where <div class="download"><div class="downloadBase"><div class="highlightedDiv"> is the data i wanted, but 
);jsonp1274754505287(   is being added into the data for some reason and invalidated the xml.

I am not sure whether this is caused by jquery ajax function when the data is very big, or its caused by asp.net webservice couldn't handle large data. 


Can someone help me with this problem please? Any help will be appreciated. Thanks in advance.

*********Code shown below***********
$.ajax({ url: "webserviceURL/getHTML.asmx/cd_GetHtml",
    contentType: "application/json; charset=utf-8",
    data: d,
       dataType: "jsonp",
       success: function(data,textStatus, XMLHttpRequest) {
        HTML = data.d;
                $("#Div1 ").empty();
                $("#Div1 ").text(HTML );
            },
       error: function(XMLHttpRequest, textStatus, errorThrown) {
               alert("errr");
            }
     });

It works fine when the returned data from server is small, when its too big, this script will stop working because the callback being added into the page like the following.
<div class="download);jsonp1274754505287("><div class="downloadBase"><div class="highlightedDiv">

In the asp.net webservice, 

I have modified the IHttpModule as,
public void OnReleaseRequestState(object sender, EventArgs e)
 {
            HttpApplication app = (HttpApplication)sender;
            HttpResponse response = app.Response;
            if (app.Context.Request.ContentType != JSON_CONTENT_TYPE) return;

            response.Filter = new JsonResponseFilter(response.Filter);
 }

public class JsonResponseFilter : Stream
{
        public override void Write(byte[] buffer, int offset, int count)
        {           
            string strBuffer = Encoding.UTF8.GetString(buffer, offset, count);
            strBuffer = AppendJsonpCallback(strBuffer, HttpContext.Current.Request);
            byte[] data = Encoding.UTF8.GetBytes(strBuffer);
            _responseStream.Write(data, 0, data.Length);
        }

        private string AppendJsonpCallback(string strBuffer, HttpRequest request)
        {
            return request.QueryString["callback"] + "(" + strBuffer + ");";
        }
}