Sign In  Sign Up Live-Chat

Editor error-Please help

Last post 06-18-2008, 11:19 AM by mf. 7 replies.
Sort Posts: Previous Next
  •  06-16-2008, 3:14 PM 131458

    Editor error-Please help

    I'm using the text editor and i can't load a document on the page. I get the error "No Document was received from the server." I followed the instructions from the help file with the only difference being that I used VB instead of C# but still everything should still work correctly. I appreciate your help. Thanks.  
     
  •  06-16-2008, 6:29 PM 131485 in reply to 131458

    Re: Editor error-Please help

    Hi,
    thanks for your interest in Aspose.Editor!

    This error happens when server replies with the null document stream to the client. The typical reason for it is that server assigned null stream (or stream with position at the end) to the DocumentEventArgs parameter.

    If you can send code of the DocumentRequested event handler (server side) I will be able to provide more details.

    Kind regards,
    Michael

     
  •  06-17-2008, 11:03 AM 131660 in reply to 131485

    Re: Editor error-Please help

    Thanks here are both event handlers i'm using:

    Protected Sub EditorControl1_DocumentReceived(ByVal sender As Object, ByVal e As Aspose.Editor.Server.DocumentEventArgs) Handles EditorControl1.DocumentReceived
            Dim FileStream As Stream = File.Create(Application("FileName"))
            MsgBox(Server.MapPath("FileNotFound.rtf"))
            e.GetDocument(FileStream, Aspose.Editor.Server.DocumentFormat.Doc)

            FileStream.Close()
        End Sub

        Protected Sub EditorControl1_DocumentRequested(ByVal sender As Object, ByVal e As Aspose.Editor.Server.DocumentEventArgs) Handles EditorControl1.DocumentRequested
            Dim FileStream As Stream = File.OpenRead(Application("FileName"))

            e.SetDocument(FileStream)

            FileStream.Close()
        End Sub

    and in the .aspx page:

    <script language="javascript" type="text/javascript">
        var ServerUrl = '<%=Page.Request.Url.AbsoluteUri%>';

    function SendDocument()

    {

    control = document.getElementById('EditorControl1');

    control.Cookie = document.cookie;

    control.Send(ServerUrl, "");

    control.focus();

    }

    function ReceiveDocument()

    {

    control = document.getElementById('EditorControl1');

    control.Receive(ServerUrl, "");

    control.focus();

    }

    function OnLoad()

    {
    //EditorControl1.OnPageLoad();
    control = document.getElementById('EditorControl1');

    control.Open();

    control.focus();


    }</script>
    </body>

    Thanks again.

     
  •  06-17-2008, 6:27 PM 131725 in reply to 131660

    Re: Editor error-Please help

    Hi,
    in the EditorControl1_DocumentRequested method please assert that stream is not null, not empty and at position 0. If everything seems OK please monitor HTTP traffic and make sure document is sent to the client. If this is also works and you feel like this must be an issue with the control, you can attach your project to the forum so I can debug it and tell you for sure what is wrong.

    Kind regards,
    Michael

     
  •  06-18-2008, 9:33 AM 131896 in reply to 131725

    Re: Editor error-Please help

    I put a break at the beginning of DocumentRequested and it never gets there. Not even when I press the buttons on the page. The page loads and I can see the control but I just can't load a document into the control. It seems like I can't get the event to be called. The problem might be on the html end on the page.

    The project i'm working on is huge so attaching it might not be an option. I'll see if i can take the two files out and make them a project of their own.

     
  •  06-18-2008, 10:20 AM 131915 in reply to 131896

    Re: Editor error-Please help

    Hi,
    please make sure that first statement of the Page_Load method of you page calls to OnPageLoad method of the server control. Only if you do that events will fire.

    Kind regards,
    Michael

     
  •  06-18-2008, 11:03 AM 131927 in reply to 131915

    Re: Editor error-Please help

    Ok that actually fixed it. Thanks. New question though: all our files include headers and footers, does this tool have an option to display them?
     
  •  06-18-2008, 11:19 AM 131933 in reply to 131927

    Re: Editor error-Please help

    Hi,
    headers and footers are not rendered by control yet. However you will not break them when document is edited. After you save your document they will be in place.

    Best regards,
    Michael.

     
View as RSS news feed in XML