Javascript 删除文件后上载文件输入消失
我正在开发2011年创建的网站,该网站使用Telerik UI实现APS.NETMVC和jquery插件上传。我的问题是,当我从电脑上传文件并将其删除时,负责上传文件的按钮就消失了,要重复操作,我需要刷新浏览器。附加仅限于一个文件。 这是从cshtml文件创建的部分:Javascript 删除文件后上载文件输入消失,javascript,c#,jquery,.net,asp.net-mvc,Javascript,C#,Jquery,.net,Asp.net Mvc,我正在开发2011年创建的网站,该网站使用Telerik UI实现APS.NETMVC和jquery插件上传。我的问题是,当我从电脑上传文件并将其删除时,负责上传文件的按钮就消失了,要重复操作,我需要刷新浏览器。附加仅限于一个文件。 这是从cshtml文件创建的部分: @(Html.Telerik().Upload() .Name("coreDocument") .Multiple(false)
@(Html.Telerik().Upload()
.Name("coreDocument")
.Multiple(false)
.Async(asyncx => asyncx
.Save("SaveCoreDocument", "Document"
, new { documentStoragePath = Model.CoreDocument.DocumentStoragePath })
.Remove("RemoveCoreDocument", "Document"
, new { documentStoragePath = Model.CoreDocument.DocumentStoragePath })
.AutoUpload(true)
).ClientEvents(
ev =>
{
ev.OnUpload("onCoreUpload");
ev.OnSuccess("onSuccess");
ev.OnError("onError");
ev.OnRemove("onCoreRemove");
})
控制器如下所示:
public ActionResult RemoveCoreDocument(string[] fileNames, string documentStoragePath)
{
_fileManager.ClearDirectory(ApplicationStoragePath, documentStoragePath);
// The parameter of the Remove action must be called "fileNames"
//foreach (var fullName in fileNames)
//{
//ClearDirectory(documentStoragePath);
//DeleteFile(Path.GetFileName(fullName), documentStoragePath);
//}
// Return an empty string to signify success
//return new JsonResult { Data = new { success = true}};
return Content("");
}
上传部分的HTML是:
<div class="t-widget t-upload">
<div class= "t-dropzone">
<div class="t-button t-upload-button">
<span>Select...</span>
<input id ="coreDocument" name="coreDocument" type="file" autocomplete="off">
</div>
<em> drop files here to upload</em>
</div>
</div>
那么,你知道我应该从哪里开始吗?也许您在这里看到了一个明显的bug,或者您知道这是由于某些库的过时版本造成的吗?我是这个项目的新手,这里没有更高级的开发人员…您的浏览器开发人员工具应该能够在这里帮助您。不过,jQuery1.5.1是九年前发布的。。
if (icon.hasClass("t-delete")) {
if (!$t.trigger(this.wrapper, "remove", eventArgs)) {
fileEntry.trigger("t:remove");
}