[CLOSED] [1.0] NORESPONSE in Button with IsUpload=true

  1. #1

    [CLOSED] [1.0] NORESPONSE in Button with IsUpload=true

    Hi,

    I want to offer a PDF Download via an Ext.NET Button but I am always getting a NORESPONSE error.

    Here is my sample (with a gif file download, but should be the same like a PDF url)

    <%@ Page Language="C#" AutoEventWireup="true" %>
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title></title>
    </head>
    <body>
        <form id="form1" runat="server">
        <ext:ResourceManager ID="masterScriptManagerCoolite" runat="server" Theme="Gray"
            ScriptMode="Debug" />
        <div>
            <ext:FormPanel ID="formPanel" runat="server" LabelWidth="80" Border="false"
                ColumnWidth="0.65">
                <Items>
                    <ext:Button runat="server" ID="buttonManual" Text="" FieldLabel="Test" Icon="PageWhiteAcrobat"
                        Flat="true">
                        <DirectEvents>
                            <Click Url="https://examples2.ext.net/resources/images/ext_net_badge.gif" Timeout="60000"
                                IsUpload="true" FormID="formPanel" Method="POST" Before="Ext.Msg.wait('Downloading...', 'Download');">
                                <EventMask MinDelay="250" />
                            </Click>
                        </DirectEvents>
                    </ext:Button>
                </Items>
            </ext:FormPanel>
        </div>
        </form>
    </body>
    </html>
    Regards,

    Martin
    Last edited by Daniil; Oct 25, 2010 at 7:43 PM. Reason: [CLOSED]
  2. #2
    Hi,

    1. You cannot use external url because XMlHttpRequest (ajax) doesn't work with cross domain urls
    2. IsUpload uses POST request always but web server forbid POST request for many type of files (including images)

    Therefore I recommend to create http handler and pass url to that http handler via DirectEvent, in that handler download the file via WebRequest class and pass it back to the client
    WebRequest request = WebRequest.Create(myurl);
    WebResponse response = request.GetResponse(); 
    StreamReader sr = new StreamReader(response.GetResponseStream(), System.Text.Encoding.Default);
    String file = sr.ReadToEnd();
    context.Response.Write(file);
    sr.Close();

Similar Threads

  1. Replies: 16
    Last Post: May 18, 2012, 7:29 AM
  2. [CLOSED] Save File dialogbox coming when IsUPload="true"
    By webppl in forum 1.x Legacy Premium Help
    Replies: 11
    Last Post: May 17, 2011, 10:35 AM
  3. Finish AjaxEvent with isUpload=true
    By Kaido in forum 1.x Help
    Replies: 0
    Last Post: Nov 09, 2010, 3:25 PM
  4. [CLOSED] [1.0] ExtraParams with DirectEvent when IsUpload="true"
    By rcaunt in forum 1.x Legacy Premium Help
    Replies: 5
    Last Post: May 06, 2010, 6:35 PM
  5. Replies: 0
    Last Post: Apr 24, 2009, 11:02 AM

Posting Permissions