Hello,
I would like to add a simple combox (not telerik) with items in it as an additional field to the RadUpload control.
Here is my code:
Please help.
Thanks,
I would like to add a simple combox (not telerik) with items in it as an additional field to the RadUpload control.
Here is my code:
<%@ Page Title="Home Page" Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="MultiFileUploadPrototype._Default" %>
<%@ register tagprefix="telerik" namespace="Telerik.Web.UI" assembly="Telerik.Web.UI" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/tr/xhtml11/dtd/xhtml11.dtd">
<
html
xmlns
=
"http://www.w3.org/1999/xhtml"
>
<
head
id
=
"Head1"
runat
=
"server"
>
<
link
rel
=
"stylesheet"
type
=
"text/css"
href
=
"styles.css"
/>
</
head
>
<
body
class
=
"BODY"
>
<
form
runat
=
"server"
id
=
"mainForm"
method
=
"post"
>
<
telerik:RadScriptManager
ID
=
"RadScriptManager1"
runat
=
"server"
/>
<
telerik:RadProgressManager
ID
=
"Radprogressmanager1"
runat
=
"server"
/>
<
table
>
<
tr
>
<
td
class
=
"TopCell"
colspan
=
"2"
>
</
td
>
</
tr
>
<
tr
>
<
td
class
=
"BodyCell"
>
<
div
class
=
"FileDetails"
>
<
telerik:RadAsyncUpload
runat
=
"server"
id
=
"RadAsyncUpload1"
OnClientFileUploaded
=
"onClientFileUploaded"
MultipleFileSelection
=
"Automatic"
>
</
telerik:RadAsyncUpload
>
</
div
>
</
td
>
<
td
class
=
"BodyCell RightCell"
>
<
div
class
=
"uploadedfiles"
>
<
div
>
<
asp:Label
ID
=
"labelNoResults"
runat
=
"server"
Visible
=
"True"
>No uploaded files</
asp:Label
>
<
asp:Repeater
runat
=
"server"
ID
=
"Repeater1"
>
<
ItemTemplate
>
Category: <%#((Telerik.Web.UI.UploadedFile)Container.DataItem).GetFieldValue("TextBox").ToString()%>,<
br
/>
File name: <%# DataBinder.Eval(Container.DataItem, "FileName").ToString() %>,<
br
/>
File size: <%# DataBinder.Eval(Container.DataItem, "ContentLength").ToString() %><
br
/>
<
br
/>
<
br
/>
</
ItemTemplate
>
</
asp:Repeater
>
</
div
>
</
div
>
</
td
>
</
tr
>
<
tr
>
<
td
class
=
"BottomCell"
colspan
=
"2"
>
<
asp:Button
ID
=
"buttonSubmit"
runat
=
"server"
CssClass
=
"RadUploadButton"
OnClick
=
"buttonSubmit_Click"
Text
=
"Submit"
/>
</
td
>
</
tr
>
</
table
>
<
telerik:RadProgressArea
runat
=
"server"
ID
=
"ProgressArea1"
></
telerik:RadProgressArea
>
<
script
type
=
"text/javascript"
>
var $ = $telerik.$;
function onClientFileUploaded(radAsyncUpload, args) {
var $row = $(args.get_row());
var categoryInputName = radAsyncUpload.getAdditionalFieldID("TextBox");
var categoryInputType = "text";
var categoryInputID = categoryInputName;
var categoryInput = createInput(categoryInputType, categoryInputID, categoryInputName);
var categoryLabel = createLabel(categoryInputID, "Category");
// var subCategoryInputName = radAsyncUpload.getAdditionalFieldID("ComboBox");
// var subCategoryInputID = subCategoryInputName;
// var subCategoryInput = createComboBox(subCategoryInputID);
// var subCategoryLabel = createLabel(subCategoryInputID, "Category");
$row.append("<
br
/>");
$row.append(categoryLabel);
$row.append(categoryInput);
// $row.append("<
br
/>");
// $row.append(subCategoryLabel);
// $row.append(subCategoryInput);
}
function createInput(inputType, inputID, inputName) {
var input = '<
input
type
=
"' + inputType + '"
id
=
"' + inputID + '"
name
=
"' + inputName + '"
/>';
return input;
}
// function createComboBox(inputID) {
// var cmbBox = '<
telerik:RadComboBox
id
=
"' + inputID + '"
/>';
// return cmbBox;
// }
function createLabel(forArrt, labelName) {
var label = '<
label
for
=
' + forArrt + '
>' + labelName + ': </
label
>';
return label;
}
</
script
>
</
form
>
</
body
>
</
html
>
Please help.
Thanks,