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

[Solved] ASP.Net AJAX RadUpload Control in MVC

1 Answer 159 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
William
Top achievements
Rank 1
William asked on 18 Oct 2010, 10:33 PM
I'm having problems getting the RadUpload control, particularly the Progress Monitors, working in my MVC application.  I am able to upload a file, and it gets to the controller, but it does not show the progress control and it does not handle large files.  I've followed the steps needed to integrate the control into MVC that I found here, http://www.telerik.com/help/aspnet-ajax/mvc-using-upload.html
but I'm still seeing the issue.   Below is the code I'm using to display the upload control.  Am I missing anything?

View
<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage" %>
 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head runat="server">
    <title>FileUpload</title>
</head>
<body>
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
    </telerik:RadScriptManager>
    <div>
        <% using (Html.BeginForm("Upload", "Appointment", FormMethod.Post, new { enctype = "multipart/form-data" }))
           {%>
        <telerik:RadUpload runat="server" ID="RadUpload1">
        </telerik:RadUpload>
        <telerik:RadProgressManager runat="server" ID="RadProgressManager1" AjaxUrl="~/Telerik.RadUploadProgressHandler.axd" />
        <telerik:RadProgressArea runat="server" ID="RadProgressArea1" />
        <input type="submit" value="Upload" />
        <%} %>
    </div>
</body>
</html>

Controller
public ActionResult FileUpload()
{
    return View();
}
 
public ActionResult Upload()
{
    if(Request.Files.Count > 0)
    {
        return View("FileUpload", new {filename= Request.Files[0].FileName});
    }
 
    return View("FileUpload");
}

Web.config
<system.web>
  <httpHandlers>
    <remove verb="*" path="*.asmx" />
    <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
    <add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
    <add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false" />
    <add verb="*" path="*.mvc" validate="false" type="System.Web.Mvc.MvcHttpHandler, System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
    <add verb="GET,HEAD" path="asset.axd" validate="false" type="Telerik.Web.Mvc.WebAssetHttpHandler, Telerik.Web.Mvc" />
  </httpHandlers>
  <httpModules>
    <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
    <add name="UrlRoutingModule" type="System.Web.Routing.UrlRoutingModule, System.Web.Routing, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
  </httpModules>
</system.web>
 
<system.webServer>
  <validation validateIntegratedModeConfiguration="false" />
  <modules runAllManagedModulesForAllRequests="true">
    <remove name="ScriptModule" />
    <remove name="UrlRoutingModule" />
    <add name="ScriptModule" preCondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
    <add name="UrlRoutingModule" type="System.Web.Routing.UrlRoutingModule, System.Web.Routing, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />    
    <add name="RadUploadModule" preCondition="integratedMode" type="Telerik.Web.UI.RadUploadHttpModule" />
  </modules>
  <handlers>
    <remove name="WebServiceHandlerFactory-Integrated" />
    <remove name="ScriptHandlerFactory" />
    <remove name="ScriptHandlerFactoryAppServices" />
    <remove name="ScriptResource" />
    <remove name="MvcHttpHandler" />
    <remove name="UrlRoutingHandler" />
    <remove name="asset" />
    <add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
    <add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
    <add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
    <add name="MvcHttpHandler" preCondition="integratedMode" verb="*" path="*.mvc" type="System.Web.Mvc.MvcHttpHandler, System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
    <add name="UrlRoutingHandler" preCondition="integratedMode" verb="*" path="UrlRouting.axd" type="System.Web.HttpForbiddenHandler, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
    <add name="asset" preCondition="integratedMode" verb="GET,HEAD" path="asset.axd" type="Telerik.Web.Mvc.WebAssetHttpHandler, Telerik.Web.Mvc" />
    <add name="Telerik_Web_UI_WebResource_axd" verb="*" preCondition="integratedMode" path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource" />
    <add name="Telerik_RadUploadProgressHandler_ashx" verb="*" preCondition="integratedMode" path="Telerik.RadUploadProgressHandler.axd" type="Telerik.Web.UI.RadUploadProgressHandler" />
  </handlers>
</system.webServer>

1 Answer, 1 is accepted

Sort by
0
William
Top achievements
Rank 1
answered on 19 Oct 2010, 03:40 PM
Here's a bit more information to help diagnose my problem.

  • I'm using IIS7
  • I'm using version 2010.2.826.35 of Telerik.Web.UI
  • When I try to upload a large file (~50MB), I see two requests to Telerik.RadUploadProgressHandler.axd in Fiddler, And the response for both is 
    var rawProgressData = {InProgress:false,ProgressCounters:false};
Tags
General Discussions
Asked by
William
Top achievements
Rank 1
Answers by
William
Top achievements
Rank 1
Share this question
or