Monday, April 6, 2009

Truncated responseText Problem of XmlHttp Object in I.E

Hi Friends..
have you ever Work XmlHttp Object for Async Request to server ??
if yes this stuff can help you some time in programming..
when you send request and get result in OnStateChange Event of XmlHttp object(xmlhttp.onreadystatechange ).

Some time In Some browsers like (I.E 7) you output Will Truncated..

For Example:
Your server returns "Hi Haresh Dhameliya!!How R U??.......This Will Truncated.."
and in output(xmlhttp.responseText) will Get Only "Hi Haresh Dhameliya!!How R U??"
then you have to Find Solution.
Here is the Solution..
(1):Internet Explorer
I.E Cause this if You Have Use GET Method like:

xmlhttp.open("GET","Your Url Generationg Response.aspx .ashx",true);

To Solve This In Case of I.E You Have To Put.

xmlhttp.open("POST","Your Url Generationg Response.aspx .ashx",true);

If you Write Post In Place of GET I.E Will not Cause Truncation of responseText.
This is Strange problem.I cant geting why this occurs in I.E ??
please tell me if u know..or you have other solution than this..
Thanks..