search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

modal Form hangs after submit

Asked by Phil
9 years ago.

I've have my application working nicely on my development machine, however, when I publish this to a web server the modal form hangs when I click the OK or Cancel button. This is using the functionality included in the demo's using modal.js and Modal.cs. Does anyone else recognise this problem? I've tested this in firefox, ie and chrome with similar results. Chrome says:

This web page is not available
The web page at http://tur-crmdev1:777/myapp/Edit.aspx?id=58b27123-0cd6-e111-b6ff-0050569b0061 might be temporarily down or it may have moved permanently to a new web address.
Here are some suggestions:
Reload this web page later.
Error 355 (net::ERR_INCOMPLETE_CHUNKED_ENCODING): The server closed the connection unexpectedly.

Answer posted by Dan Letecky [DayPilot]
9 years ago.


It seems to be related to the Content-Length header and response encoding. Could you please try to post the response HTTP headers? It should look like this:

Date:Mon, 30 Jul 2012 07:13:28 GMT

I've also tried to make a few modifications of Modal.cs but these are blind guesses. The following changes have been made:

  • page.Response.ClearContent() replaced by Response.Clear() and Response.ContentType
  • page.Response.Buffer = true; added

You can also try disabling the Content-Length header.

    public static void Close(Page page, object result)
        page.Response.ContentType = "text/html";
        page.Response.Buffer = true;

        StringBuilder sb = new StringBuilder();
        sb.Append("<script type='text/javascript'>");
        sb.Append("if (parent && parent.DayPilot && parent.DayPilot.ModalStatic) {");
        sb.Append("parent.DayPilot.ModalStatic.result = " +
                  DayPilot.Web.Ui.Json.SimpleJsonSerializer.Serialize(result) + ";");
        sb.Append("if (parent.DayPilot.ModalStatic.hide) parent.DayPilot.ModalStatic.hide();");

        string output = sb.ToString();
        byte[] s = Encoding.UTF8.GetBytes(output);
        page.Response.AddHeader("Content-Length", s.Length.ToString());




Please let me know if it didn't help.

Comment posted by Phil
9 years ago.

Thanks a lot for your help - I recoded the modal form to use my own mechanisim so I don't have the version with the problem anymore. I'll look at your suggestions if I go back to your solution.

Comment posted by Anonymous
9 years ago.

Error 355 (net::ERR_INCOMPLETE_CHUNKED_ENCODING): The server closed the connection unexpectedly.

I get the above messages very often when i browse the web.
I don't know what to do about this,it really annoying.

Comment posted by Anonymous
8 years ago.

I have to use "Modal.Close(this);" in my page for modal cancel button.
However it does not work. It works only for daypilot - edit.aspx & new.aspx pages.
Could you please help me for that? I tried to change the coding as before but it still not working.
Thank you

This question is more than 3 months old and has been closed. Please create a new question if you have anything to add.