[jQuery] Re: AJAX with IE and method POST

2008-12-27 Thread JQueryProgrammer

Thanks a ton George. You saved my day. I have been trying to getting
this issue and was searching for a solution. Your post helped.

On Nov 15, 1:29 am, George gev @comcast.net wrote:
 No i did not...I did pass exactly this '{}' (empty JSON data).

 As i said the problem was that i were not reading the InputStream till
 the end cause i knew that data would be empty. And it messes up IE's
 XMLHttpRequest object so it can not read properly output from the
 server.

 George.

 On Nov 14, 2:22 pm, Mike Nichols nichols.mik...@gmail.com wrote:

  did you forget to pass data (data:{}) in the ajax call? I have had
  that trip me up when doing posts via ajax.

  On Nov 14, 10:35 am, George gev...@comcast.net wrote:

   Hi guys/girls,
   I just wanted to post here my problems (and solution) I had been
   struggling with last 2 days.

   I was doing JQuery AJAX POST and it was not working in IE wile working
   in FireFox.
   Sometimes you will get12030error (Server unexpectedly terminated
   connection) from IE's XMLHttpRequest object.

   I discovered that in order for IE's XMLHttpRequest object to properly
   read return stream the input stream must be completely read by the
   server (even if you are not interested in it).

   Some frameworks do it automatically and some do not. For example
   ASP.NET does not do it automatically.
   I was trying to do POST to .ashx handler and was getting errors.

   So adding this code to my handler fixed the problem.

   System.IO.Stream st = context.Request.InputStream;
           byte []buf = new byte[100];
           while (true)
           {
               int iRead = st.Read(buf, 0, 100);
               if( iRead == 0 )
                   break;
           }
           st.Close();

   So I am just posing it for Google to spider it and people to be able
   to find it. Cause when I googled I found a lot of people having
   problem with12030error but no solution.

   Good luck,
   George- Hide quoted text -

  - Show quoted text -


[jQuery] Re: AJAX with IE and method POST

2008-11-14 Thread Mike Nichols

did you forget to pass data (data:{}) in the ajax call? I have had
that trip me up when doing posts via ajax.

On Nov 14, 10:35 am, George [EMAIL PROTECTED] wrote:
 Hi guys/girls,
 I just wanted to post here my problems (and solution) I had been
 struggling with last 2 days.

 I was doing JQuery AJAX POST and it was not working in IE wile working
 in FireFox.
 Sometimes you will get 12030 error (Server unexpectedly terminated
 connection) from IE's XMLHttpRequest object.

 I discovered that in order for IE's XMLHttpRequest object to properly
 read return stream the input stream must be completely read by the
 server (even if you are not interested in it).

 Some frameworks do it automatically and some do not. For example
 ASP.NET does not do it automatically.
 I was trying to do POST to .ashx handler and was getting errors.

 So adding this code to my handler fixed the problem.

 System.IO.Stream st = context.Request.InputStream;
         byte []buf = new byte[100];
         while (true)
         {
             int iRead = st.Read(buf, 0, 100);
             if( iRead == 0 )
                 break;
         }
         st.Close();

 So I am just posing it for Google to spider it and people to be able
 to find it. Cause when I googled I found a lot of people having
 problem with 12030 error but no solution.

 Good luck,
 George


[jQuery] Re: AJAX with IE and method POST

2008-11-14 Thread George

No i did not...I did pass exactly this '{}' (empty JSON data).

As i said the problem was that i were not reading the InputStream till
the end cause i knew that data would be empty. And it messes up IE's
XMLHttpRequest object so it can not read properly output from the
server.


George.

On Nov 14, 2:22 pm, Mike Nichols [EMAIL PROTECTED] wrote:
 did you forget to pass data (data:{}) in the ajax call? I have had
 that trip me up when doing posts via ajax.

 On Nov 14, 10:35 am, George [EMAIL PROTECTED] wrote:



  Hi guys/girls,
  I just wanted to post here my problems (and solution) I had been
  struggling with last 2 days.

  I was doing JQuery AJAX POST and it was not working in IE wile working
  in FireFox.
  Sometimes you will get 12030 error (Server unexpectedly terminated
  connection) from IE's XMLHttpRequest object.

  I discovered that in order for IE's XMLHttpRequest object to properly
  read return stream the input stream must be completely read by the
  server (even if you are not interested in it).

  Some frameworks do it automatically and some do not. For example
  ASP.NET does not do it automatically.
  I was trying to do POST to .ashx handler and was getting errors.

  So adding this code to my handler fixed the problem.

  System.IO.Stream st = context.Request.InputStream;
          byte []buf = new byte[100];
          while (true)
          {
              int iRead = st.Read(buf, 0, 100);
              if( iRead == 0 )
                  break;
          }
          st.Close();

  So I am just posing it for Google to spider it and people to be able
  to find it. Cause when I googled I found a lot of people having
  problem with 12030 error but no solution.

  Good luck,
  George- Hide quoted text -

 - Show quoted text -