使用asp:input时Telerik RadUpload.Net2 null引用

时间:2014-08-08 12:32:20

标签: telerik radupload

我一直在尝试使用简单的.aspx页面来使用Telerik的RadUpload.Net2,但我得到了下一行代码的空引用:

UploadedFile file = RadUploadContext.Current.UploadedFiles[File1.UniqueID];

使用以下控件时:

<input id="File1" type="file" runat="server" />
<asp:Button ID="Button1" runat="server" Text="Button" Enabled="true" OnClick="Button1_Click"/>
<radUpload:RadProgressManager runat="server" ID="Radprogressmanager"/>
<radUpload:RadProgressArea ID="RadProgressArea1" runat="server" />

我正在使用IIS 7.5和DefaultAppPool,.Net 4.0集成。 WebConfig如下:

    <configuration>
    <appSettings>
    <add key="Telerik.WebControls.RadControlsDir" value="~/Resources/RadControls/" />
    <add key="Telerik.WebControls.RadUpload.TempFolder" value="D:\Projects\ODW\Temp\Upload" />
    </appSettings>
    <system.web>
    <compilation debug="true" targetFramework="4.0">
      <assemblies>
        <add assembly="RadUpload.Net2, Version=2.4.1.0, Culture=neutral, PublicKeyToken=B4E93C26A31A21F0" />
        <add assembly="System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
        <add assembly="System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
      </assemblies>
    </compilation>
    <pages enableEventValidation="false" validateRequest="false" controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID" />
    <httpRuntime maxRequestLength="30240" executionTimeout="10" />
    <!--<httpModules>
      <add name="RadUploadModule" type="Telerik.WebControls.RadUploadHttpModule, RadUpload.Net2, Version=2.3.0.0, Culture=neutral, PublicKeyToken=b4e93c26a31a21f0" />
    </httpModules>
    <httpHandlers>
      <add verb="*" path="Telerik.RadUploadProgressHandler.aspx" type="Telerik.WebControls.RadUploadProgressHandler, RadUpload.Net2, Version=2.3.0.0, Culture=neutral, PublicKeyToken=b4e93c26a31a21f0" validate="false" />
    </httpHandlers>-->
    <trace enabled="false" pageOutput="false" requestLimit="40" localOnly="false" />
    <authorization>
        <allow users="*" />
    </authorization>
    <trust level="Full" />
  </system.web>
 <system.webServer>
    <modules runAllManagedModulesForAllRequests="true">
      <add name="RadUploadModule" type="Telerik.WebControls.RadUploadHttpModule, RadUpload.Net2, Version=2.4.1.0, Culture=neutral, PublicKeyToken=b4e93c26a31a21f0" preCondition="integratedMode" />
    </modules>
    <validation validateIntegratedModeConfiguration="false" />
    <handlers>
      <add name="Telerik_RadUploadProgressHandler_ashx" verb="*" path="Telerik.RadUploadProgressHandler.aspx" type="Telerik.WebControls.RadUploadProgressHandler, RadUpload.Net2, Version=2.4.1.0, Culture=neutral, PublicKeyToken=b4e93c26a31a21f0" preCondition="integratedMode" />
    </handlers>
    </system.webServer>
</configuration>

处理程序在IIS中注册。我已经在经典的.Net应用程序池上尝试了它,但它仍无法正常工作。

1 个答案:

答案 0 :(得分:1)

RadUpload.Net2是一个非常古老的控件(2007年之前),如果你的项目在.NET 4上,你应该使用Telerik.Web.UI程序集