0
私は2つのaspコントロールを持っています:FileUploadとボタン FileUpload上でuploadifyプロパティを追加しても動作します ボタンを使ってコードビハインドでいくつかの操作を行い、しかし、ここで codehhindからアップロードする
は私の3個のタグです...ファイルのポップアップは、私はクライアント側ですべてを軽減しようとしたテストの目的のためには表示されませんが、それはまだ動作しません
<asp:Button Text="Browse" OnClick="Carica_File_Click" runat="server" ID="UploadButton" CssClass="Load_Button" align="center"/>
<asp:Button Text="BrowseFromClient" OnClientClick="openfileDialog();" runat="server" ID="Button1" CssClass="Load_Button" align="center"/>
<asp:FileUpload runat="server" ID="FileUploadMain" align="center" />
クライアントsi私は間違って行くデ
<script type="text/javascript">
$(window).load(
function() {
$("#ContentPlaceHolderMain_FileUploadMain").uploadify({
'swf': '../Scripts/uploadify.swf',
'cancelImg': '../images/uploadify-cancel.png',
'buttonText': 'Browse Files',
'uploader': '../FrontEnd/Upload.ashx<%=GetUploadParams()%>',
'folder': '',
'fileDesc': 'UPLOAD FILES',
'fileExt': '*.jpg;*.jpeg;*.gif;*.png;*.pdf;*.doc;*.docx',
'multi': true,
'auto': true,
'buttonImage': '<%=GetUploadFileUrl()%>',
'width': 217,
'removeTimeout': 1,
'removeCompleted': false,
'buttonClass': '',
'onUploadSuccess': function() {
location.reload(true);
}
});
}
);
</script>
<script>
function openfileDialog() {
$("#FileUploadMain").click();
}
</script>
サーバー側
Protected Sub Carica_File_Click(sender As Object, e As EventArgs)
Dim ClientID As String = FileUploadMain.ClientID
ScriptManager.RegisterStartupScript(Me, Page.GetType, "Script", "document.getElementById('#" & ClientID & "').click();", True)
...code
End Sub
?私は、ファイルが正常にウィッヒが、その後
$(window).load(
function() {
$("#ContentPlaceHolderMain_FileUploadMain").uploadify({
....parameters
'onUploadSuccess': function (file, data, response) {
location.reload(true);
var ObjF = file.name;
__doPostBack('FileLoaded', ObjF);
}
});
}
);
の後ろにコードのPage_Loadの上で処理されてアップロードされた場合にポストバックタグを強制的にコードを実行するための
:最後に