我正在尝试借助 EXT.NET 2.0 版将文件上传到服务器
在我的情况下:我写在
<ext:FileUploadField ID="FileUploadField1" runat="server" Width="300"><DirectEvents>
</DirectEvents></ext:FileUploadField>
<FileSelected OnEvent="FileUploadField_FileSelected" IsUpload="true" />
在FileSelected 不可用时给我错误
我的代码:
<%@ Page Language="C#" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Ext.NET Example</title>
</head>
<body>
<form runat="server">
<ext:ResourceManager runat="server" />
<ext:FileUploadField ID="FileUploadField1" runat="server" Width="300">
<DirectEvents>
<FileSelected OnEvent="FileUploadField_FileSelected" IsUpload="true" />
</DirectEvents>
</ext:FileUploadField>
</form>
</body>
</html>
我的 C# 代码:在此 SaveAs 选项中无效,其生成错误:
protected void FileUploadField_FileSelected(object sender, DirectEventArgs e)
{
this.FileUploadField1.SaveAs(@"D:\video1.mp4");
}