Topbar
Topbar
Sign in
|
Join
|
Client Center
Home
Products
Client Center
Contact
Purchase
Support forums
»
Products
»
Ajax Uploader
»
Re: Manual upload with visible="false"
Re: Manual upload with visible="false"
11-13-2012, 2:44 AM
AlxReiter
Joined on 10-26-2012
Russia
Posts 12
Re: Manual upload with visible="false"
Reply
Quote
<
%@ Page
Language
=
"C#"
AutoEventWireup
=
"true"
CodeBehind
=
"_myStartUploadingManually.aspx.cs"
Inherits
=
"AJAXUploader_new_version_basic_samples._myStartUploadingManually"
%
>
<
%@ Register
TagPrefix
=
"CuteWebUI"
Namespace
=
"CuteWebUI"
Assembly
=
"CuteWebUI.AjaxUploader"
%
>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
>
<
html
xmlns
=
"http://www.w3.org/1999/xhtml"
>
<
head
id
=
"Head1"
runat
=
"server"
>
<
title
>
Start uploading manually
</
title
>
<
link
rel
=
"stylesheet"
href
=
"demo.css"
type
=
"text/css"
/>
<
script
type
=
"text/javascript"
src
=
"jquery-1.8.2.min.js"
>
</
script
>
<
script
type
=
"text/javascript"
>
function CuteWebUI_AjaxUploader_OnSelect(files) {
for (var
i
=
0
; i
<
files.length
; i++) {
if (files[i].FileSize
>
2097152)
alert("File to large!");
files[i].Cancel();
}
}
function submitbutton_click() {
var
submitbutton
=
document
.getElementById('
<
%=SubmitButton.ClientID %
>
');
var
fileInputs
= ["
<
%=fileinput1.ClientID%
>
", "
<
%=fileinput2.ClientID%
>
", "
<
%=fileinput3.ClientID%
>
"];
if (!window.filesuploaded) {
for(var
i
=
0
; i
<
3
; i++) {
var
uploadobj
=
document
.getElementById(fileInputs[i]);
if (uploadobj.getqueuecount()
>
0) {
uploadobj.startupload();
}
}
return false;
}
window.filesuploaded
=
false
;
return true;
}
</
script
>
</
head
>
<
body
>
<
form
id
=
"form1"
runat
=
"server"
>
<
asp:ScriptManager
ID
=
"Scriptmanager1"
runat
=
"server"
>
</
asp:ScriptManager
>
<
asp:UpdatePanel
ID
=
"UpdatePanel1"
runat
=
"server"
>
<
ContentTemplate
>
<
table
border
=
"0"
cellpadding
=
"0"
cellspacing
=
"0"
width
=
"100%"
>
<
tr
valign
=
"middle"
>
<
td
class
=
'standardText'
>
<
asp:Label
Visible
=
"false"
ID
=
"label1"
runat
=
"server"
>First file for upload
</
asp:Label
>
</
td
>
<
td
class
=
'standardText'
>
<
CuteWebUI:Uploader
runat
=
"server"
ManualStartUpload
=
"true"
ID
=
"fileinput1"
InsertText
=
"Browse Files1"
onfileuploaded
=
"fileinput_FileUploaded"
MultipleFilesUpload
=
"false"
ValidateOption-MaxSizeKB
=
"2097152"
>
</
CuteWebUI:Uploader
>
</
td
>
</
tr
>
<
tr
valign
=
"middle"
>
<
td
class
=
'standardText'
>
<
asp:Label
Visible
=
"true"
ID
=
"label2"
runat
=
"server"
>Second file for upload
</
asp:Label
>
</
td
>
<
td
class
=
'standardText'
>
<
CuteWebUI:Uploader
runat
=
"server"
ManualStartUpload
=
"true"
ID
=
"fileinput2"
InsertText
=
"Browse Files2"
onfileuploaded
=
"fileinput_FileUploaded"
MultipleFilesUpload
=
"false"
ValidateOption-MaxSizeKB
=
"2097152"
>
</
CuteWebUI:Uploader
>
</
td
>
</
tr
>
<
tr
valign
=
"middle"
>
<
td
class
=
'standardText'
>
<
asp:Label
Visible
=
"true"
ID
=
"label3"
runat
=
"server"
>Last file for upload
</
asp:Label
>
</
td
>
<
td
class
=
'standardText'
>
<
CuteWebUI:Uploader
runat
=
"server"
ManualStartUpload
=
"true"
ID
=
"fileinput3"
InsertText
=
"Browse Files3"
onfileuploaded
=
"fileinput_FileUploaded"
MultipleFilesUpload
=
"false"
ValidateOption-MaxSizeKB
=
"2097152"
>
</
CuteWebUI:Uploader
>
</
td
>
</
tr
>
<
caption
>
<
p
>
<
asp:Button
ID
=
"SubmitButton"
runat
=
"server"
Text
=
"Submit"
OnClientClick
=
"return submitbutton_click()"
/>
</
p
>
</
caption
>
</
table
>
</
ContentTemplate
>
</
asp:UpdatePanel
>
</
form
>
</
body
>
</
html
>
View Complete Thread