This is a migrated thread and some comments may be shown as answers.

[Solved] Hooking into HttpApplication Events breaks RadProgressArea control

1 Answer 108 Views
Upload (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Chris
Top achievements
Rank 1
Chris asked on 10 Jun 2009, 08:53 PM
Hello,

I've been trying to use the RadProgressArea in one of our web apps and haven't been able to get it to work.  I traced the problem down to an event we're firing to execute a custom context resolver, that passes the Request.Params collection.  If I remove the event code the progress area works fine.

I've pasted below a sample that illustrates this bug. 

I created an ASP.NET 2.0 web site, and here is the default.aspx:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %> 
 
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"
<head runat="server"
    <title>Untitled Page</title> 
</head> 
<body> 
    <form id="form1" runat="server"
            <telerik:RadScriptManager ID="RadScriptManager1" runat="server"
            </telerik:RadScriptManager> 
            <br /> 
            &nbsp;<telerik:RadUpload ID="RadUpload1" runat="server" TargetFolder="Uploads"
            </telerik:RadUpload> 
            <br /> 
            <asp:Button ID="Button1" runat="server" Text="Upload" /><br /> 
            <telerik:RadProgressManager ID="RadProgressManager1" runat="server" /> 
            <br /> 
            <telerik:RadProgressArea ID="RadProgressArea1" runat="server"
            </telerik:RadProgressArea> 
             
    </form> 
</body> 
</html> 

I used the SmartTag feature to set up my Web.Config and ran the project.  The upload worked fine, and the Progress Area appeared as expected.

I then created this class:



using System; 
using System.Collections.Specialized; 
using System.Web; 
 
public class OverrideApp : HttpApplication 
    public OverrideApp() 
    { 
        PostResolveRequestCache += PopulateContext; 
    } 
 
    public void PopulateContext(object sender, EventArgs e) 
    { 
        Object context = new object(); 
        BuildContext(context, Request.Params); 
    } 
 
    private void BuildContext(object context, NameValueCollection nameValueCollection) 
    { 
        return
    } 
 

and added this to my Global.asax:
<%@ Application Language="C#" Inherits="OverrideApp" %> 

Now if I run the project, the file upload still works but the Progress Area does not appear.

I am using the latest Telerik build, ASP.NET AJAX for 5/27/2009.  The file I am uploading is 78MB in size, and takes a couple seconds on a localhost, long enough to see the progress area appear.

Please advise if there is any work around, because as it stands we can't use the control in our web applications because of this issue.

Thanks,
-Chris

1 Answer, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 15 Jun 2009, 12:54 PM
Hi Chris,

After thorough debugging it turned out that calling Request.Params parses (uploads) everything which in turn leaves RadUpload with empty request. Hence no progress is displayed. There are two possible workarounds:
  1. Don't use Request.Params in your code. Use Request.QueryString instead. It does not force the upload.
  2. Subscribe to some event which occurs after RadUpload's progress handling - for example PostRequestHandlerExecute (which is where RadUpload stops processing the request).

Regards,
Albert
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Upload (Obsolete)
Asked by
Chris
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Share this question
or