我用的是AsyncUpload
function onClientFileUploaded(radAsyncUpload,args) {
var row = args.get_row(),inputName = radAsyncUpload.getAdditionalFieldID("TextBox"),inputType = "text",inputID = inputName,input = createInput(inputType,inputID,inputName),label = createLabel(inputID),br = document.createElement("br");
row.appendChild(br);
row.appendChild(input);
row.appendChild(label);
}
function createInput(inputType,inputName) {
var input = document.createElement("input");
input.setAttribute("type",inputType);
input.setAttribute("id",inputID);
input.setAttribute("name",inputName);
return input;
}
我想访问.cs中的文本框(动态创建).
怎么做 ?
完整答案:
var $= $telerik.$;
function onClientFileUploaded(radAsyncUpload,args) {
var $row = $(args.get_row());
var inputName = radAsyncUpload.getID("TextBox");
var inputType = "text";
var inputID = inputName;
var input = createInput(inputType,inputName);
var label = createLabel(inputID);
$row.append("
foreach (UploadedFile UF in rada_attach.UploadedFiles)
{
if (UF.GetFieldValue("TextBox") != null)
{
OBJ.File_name = UF.GetFieldValue("TextBox");
}
else
{
OBJ.File_name = UF.GetName();
}
最佳答案
在我看来,文档很清楚.检查您参考的页面上的描述选项卡.您可以使用回发下面的代码访问动态文本框的值:
原文链接:https://www.f2er.com/jquery/428167.htmlif (rada_attach.UploadedFiles.Count > 0) {
for (var index = 0; index < rada_attach.UploadedFiles.Count; ++index) {
var textBoxValue = rada_attach.UploadedFiles[index].GetFieldValue("TextBox");
}
}
顺便说一下,这个场景在这里得到很好的支持:Adding Information to Uploaded Files