2015-09-12 70 views
0

我的網頁和兩個按鈕上有RadAsyncUpload。 Button1的和Button2的如何限制RadAsyncUpload上單擊按鈕1上傳文件

的問題是,RadAsyncUpload是兩個按鈕,上傳文件,請單擊我希望它只是上傳文件上Button1的Click,

下面是設計規範

<div> 
     <telerik:RadScriptManager ID="RadScriptManager1" runat="server"> 
     </telerik:RadScriptManager> 
    </div> 
    &nbsp;<telerik:RadAjaxLoadingPanel 
     ID="RadAjaxLoadingPanel1" Runat="server" MinDisplayTime="2000" Skin="Default"> 
    </telerik:RadAjaxLoadingPanel> 
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"> 
    </telerik:RadAjaxManager> 
    <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" height="200px" 
     HorizontalAlign="NotSet" LoadingPanelID="RadAjaxLoadingPanel1" width="300px"> 
     <telerik:RadAsyncUpload ID="RadAsyncUpload1" runat="server" 
      MultipleFileSelection="Automatic" 
    UploadedFilesRendering="BelowFileInput"> 
     </telerik:RadAsyncUpload> 
     <asp:Button ID="Button1" runat="server" Text="Button1" /> 
     &nbsp;<asp:Button ID="Button2" runat="server" Text="Button" /> 
    </telerik:RadAjaxPanel> 

AND MY VB.NET代碼:

Imports Telerik.Web.UI 
Imports System.IO 
Partial Class Default2 
    Inherits System.Web.UI.Page 

    Protected Sub RadAsyncUpload1_FileUploaded(ByVal sender As Object, ByVal e As Telerik.Web.UI.FileUploadedEventArgs) Handles RadAsyncUpload1.FileUploaded 
     Const relativePath As String = "~/Uploads/" 
     Dim filename = e.File.FileName 
     'Dim parentID = Convert.ToInt32(GridView1.SelectedValue) 
     Dim filesize = Convert.ToInt32(e.File.ContentLength) 
     Dim physicalSavePath = MapPath(relativePath) + filename 

     'Store file info in database 
     'Dim app_FilesAdapter = New app_FilesTableAdapter() 
     'app_FilesAdapter.Insert(filename, relativePath & Convert.ToString(filename), parentID, 1, DateTime.Now, filesize) 

     'Save physical file on disk 
     e.File.SaveAs(physicalSavePath, True) 
    End Sub 

End Class 

回答

1

只要使用Postba ckTriggers =「Button1」屬性RadAsyncUpload

謝謝!!