0
我在處理程序和JavaScript中添加文件名作爲響應我試圖獲取處理程序中添加的值並將其保存到一個隱藏的領域。但隱藏的字段值始終爲空。我沒有收到我添加到響應中的文件名。我如何獲得的文件名從處理器如何將處理程序的值傳遞給aspx頁面作爲響應
public class Upload : IHttpHandler, System.Web.SessionState.IRequiresSessionState
{
public void ProcessRequest (HttpContext context)
{
context.Response.Write(filename);
context.Response.StatusCode = 200;
}
}
<script type="text/javascript">
$(document).ready(function() {
$("#<%=AFU_Video.ClientID%>").uploadify({
'uploader': 'scripts/uploadify.swf',
'script': 'Upload.ashx',
'buttonText': 'Video',
'cancelImg': 'images/cancel.png',
'folder': 'D:\Media',
'fileExt': '*.mp4',
'fileDesc': 'Video Files (.mp4 Only)',
'multi': true,
'auto': true,
'onComplete': function (event, ID, fileObj, response, data) {
document.getElementById("<%= Hidd_VideoLoc.ClientID %>").value = response.filename;