Topbar
Topbar
Sign in
|
Join
|
Client Center
Home
Products
Client Center
Contact
Purchase
Support forums
»
Products
»
Ajax Uploader
»
Can I let to two upload button for each another the db field
Can I let to two upload button for each another the db field
Last post 02-23-2011, 9:26 PM by
Kenneth
. 1 replies.
Sort Posts:
Oldest to newest
Newest to oldest
Previous
Next
02-21-2011, 7:37 PM
66340
m60dx
Joined on 02-22-2011
Posts 1
Can I let to two upload button for each another the db field
Reply
Quote
Hello...
I'm using Asp.net 4.0 MVC 3.
One Form has multi upload button?
like this;
I tried it but I encounted the Sever Error message (500)
Please let me the soulution...
I'm sorry for my english.
thanks
GoonJae Lee
02-23-2011, 9:26 PM
66406
in reply to
66340
Kenneth
Joined on 02-13-2008
Posts 3,886
Re: Can I let to two upload button for each another the db field
Reply
Quote
Hi m60dx,
The example below shows you how to synchronize two uploader
<%@ Page Language=
"C#"
%>
<!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
>
<script runat=
"server"
>
protected
void
uploader1_FileUploaded(
object
sender, UploaderEventArgs args)
{
using
(Stream str = args.OpenStream())
{
uploader2.Items.Add(args.FileSize, args.FileName, str);
}
}
protected
void
uploader1_AttachmentRemoveClicked(
object
sender, AttachmentItemEventArgs args)
{
for
(
int
i = uploader2.Items.Count - 1; i >= 0; i--)
{
if
(uploader2.Items[i].FileName == args.Item.FileName)
{
uploader2.Items[i].Remove();
}
}
}
</script>
<html xmlns=
"http://www.w3.org/1999/xhtml"
>
<head runat=
"server"
>
<title>Untitled Page</title>
</head>
<body>
<form id=
"form1"
runat=
"server"
>
<div>
<CuteWebUI:UploadAttachments ID=
"uploader1"
runat=
"server"
OnFileUploaded=
"uploader1_FileUploaded"
OnAttachmentRemoveClicked=
"uploader1_AttachmentRemoveClicked"
>
</CuteWebUI:UploadAttachments>
<CuteWebUI:UploadAttachments ID=
"uploader2"
runat=
"server"
>
</CuteWebUI:UploadAttachments>
</div>
</form>
</body>
</html>
Regards,
ken