No response with status code 200

  1. #1

    No response with status code 200

    Hi all,

    I would like to click a link in grid panel and then pop up a new window to review the pdf file. But, the program return the No response error. I have checked the status code for the server side method and it seems ok as return 200. I have no idea why the result like this. Please help me to solve it.

    In my page.aspx, the code is shown as following:
    <head runat="server">
        <title></title>
        <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
        <script type="text/javascript">
                var myCommand = function (a) {
                    return App.direct.buttonOnClick(a.id, {
                        isUpload: true 
                    });
                }
            </script>
    </head>
    
    <body>
        <form id="form1" runat="server">
        <ext:ResourceManager ID="ResourceManager1" runat="server"/>
        <ext:GridPanel ID="GridPanel1" runat="server" Width="1199" Height="500" Title="PaySlip">
            <Store>
                <ext:Store ID="PayslipStore" runat="server" RemoteSort="true" PageSize="5">
                    <Proxy>
                        <ext:PageProxy />
                    </Proxy>
                    <Model>
                        <ext:Model ID="PayslipModel" runat="server" IDProperty="fileName">
                            <Fields>
                                <ext:ModelField Name="fileName" Mapping="fileName"/>
                                <ext:ModelField Name="filePath" />
                            </Fields>
                        </ext:Model>
                    </Model>
                    <Sorters>
                        <ext:DataSorter Property="filename" Direction="ASC" />
                    </Sorters>
                </ext:Store>
            </Store>
            <ColumnModel ID="ColumnModel1" runat="server">
                <Columns>
                    <ext:RowNumbererColumn ID="RowNumbererColumn1" runat="server" Width="25" />
                    <ext:TemplateColumn Text="FileName" DataIndex="fileName" runat="server" Width="350">
                        <Template runat="server">
                            <Html>
                                <a id="{fileName}" onclick="myCommand(this)" href="javascript:void(0);" target="_blank">{fileName}</a>
                            </Html>
                        </Template>
                    </ext:TemplateColumn>>
                    <ext:Column ID="Column2" runat="server" DataIndex="filePath" Text="Path" Width="824" />
                </Columns>
                
            </ColumnModel>
            <BottomBar>
                <ext:PagingToolbar ID="PagingToolbar1" runat="server" DisplayInfo="true" DisplayMsg="Displaying files {0} - {1} of {2}"
                    EmptyMsg="No files to display" />
            </BottomBar>
        </ext:GridPanel>
        </form>
    </body>
    And the below is my aspx.cs:
    [DirectMethod(Timeout=30000)]
            public void buttonOnClick(String name)
            {
                    Response.ContentType = "application/pdf";
                    Response.AppendHeader("content-disposition", "inline; filename=" + name);
                    Config.Admin admin = Config.AdminCtrl.GetAdmin();
                    string userId = admin.UserId;
    
                    string newpath = "~/Payslip/";
                    string fileDest = newpath + userId.Trim().ToLowerInvariant() + "/" + name;
    
                    FileInfo fileInfo = new FileInfo(Server.MapPath(fileDest));
                    Response.AppendHeader("Content-Length", fileInfo.Length.ToString());
                    Response.AddHeader("Cache-control", "no-store");
                    Response.TransmitFile(Server.MapPath(fileDest));
                    Response.End();
                }
    Additional, if i use Response.ContentType = "application/octet-stream"; instead of Response.ContentType = "application/pdf";, i can download the file but i would like to pop up a new window to review it rather than download it. Is it related to the content type?
  2. #2
    Hi @cwtsang1012,

    Welcome to the Ext.NET forums!

    This stackoverflow thread might be helpful.
    http://stackoverflow.com/questions/8...g-it-using-asp
  3. #3
    Hello,

    I have tried it ... but still not work. Would you mind to explain more detail?
  4. #4
    I have tried it ... but still not work. Would you mind to explain more detail?
    What part didn't work? Did you try debugging? Did a JavaScript error get thrown?

    How about updating your sample to demonstrate what you now have configured using the suggestions provided by the StackOverflow thread?

    Please simplify your sample as much as possible, and we prefer if all code is included in one file (.aspx) and not a separate code-behind file.
    Geoffrey McGill
    Founder

Similar Threads

  1. [CLOSED] Status Code: Status Text: BADRESPONSE: Unexpected token <
    By hdsoso in forum 2.x Legacy Premium Help
    Replies: 6
    Last Post: Jun 10, 2014, 7:02 PM
  2. Replies: 1
    Last Post: Nov 28, 2013, 6:34 AM
  3. Replies: 5
    Last Post: May 27, 2013, 5:30 AM
  4. Replies: 16
    Last Post: Oct 04, 2011, 5:17 PM
  5. status text status code CUSTOM
    By threewonders in forum 1.x Help
    Replies: 0
    Last Post: Sep 26, 2011, 1:29 PM

Posting Permissions