[英]Get value from page when using ajaxfileupload with c#
I'm using the ajaxfileupload from ajaxtoolkit. 我正在使用ajaxtoolkit中的ajaxfileupload。 It sits inside a panel attached to the ajaxpanelextender.
它位于连接到ajaxpanelextender的面板内部。 It works fine.
工作正常。 I click a link inside a grid row which fires a javascript event and the panel pops up with the fileupload control.
我单击网格行内的链接,该链接会触发javascript事件,并且面板会弹出fileupload控件。
function EditInspection(link) {
// Need to get the inspection id from code behind.
_InspectionID = link.parentNode.parentNode.cells[0].innerText;
var id = document.getElementById("ContentPlaceHolder1_InspID");
id.setAttribute('value', _InspectionID);
var modal = $('.pop')
modal.trigger('click');
}
"InspID" is an asp:hidden control inside the panel. “ InspID”是面板内部的asp:hidden控件。
I select my files and click upload to get to the UploadComplete event in C#. 我选择我的文件,然后单击上载以进入C#中的UploadComplete事件。 Once I'm there I need to get a value from the InspID field.
到达那里后,我需要从InspID字段获取一个值。 But when I get to the line
但是当我上线时
string sID = InspID.Value;
the value is always an empty string. 该值始终是一个空字符串。 I also tried using a regular input but the text value is also an empty string.
我也尝试使用常规输入,但文本值也是一个空字符串。 I also tried putting the InspID control outside the panel with the same results.
我还尝试将InspID控件放在面板外部,结果相同。 I looked at the API documentation and it had something specifially for passing data - context keys - but from what I've read, it's not implementd.
我看了一下API文档,它专门用于传递数据-上下文键-但是据我所读,它尚未实现。 I can't change the source code either to implement anything.
我也不能更改源代码来实现任何东西。
How can I set a value from the javascript call and retrieve it from the code behind? 如何从javascript调用中设置一个值并从后面的代码中检索它?
Thank you. 谢谢。
Earlier it was possible so: 较早之前有可能这样:
var id = document.getElementById("<%=InspID.CLientID%>");
When the toolkit passed to DevEx ... 当工具包传递给DevEx ...
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.