我有一些处理 excel 文件的 web 表单,所以为了使这更容易,我有一个这样的基类:
public abstract class ExcelImporter : Page {
public abstract RadAsyncUpload FileUpload { get; }
protected override void OnInit(EventArgs e)
{
base.OnInit(e);
if (FileUpload != null)
{
DefineRadAyncUpload();
}
}
private void DefinirRadAyncUpload()
{
FileUpload.Skin = Skin;
FileUpload.Culture = new System.Globalization.CultureInfo("pt-BR");
FileUpload.TemporaryFolder = "~/temp";
FileUpload.OnClientFileUploaded = "PostBackAsyncUploadComplete";
FileUpload.AllowedFileExtensions = new[] { "xls", "xlsx" };
FileUpload.MaxFileInputsCount = 1;
FileUpload.FileUploaded += FileUploadOnFileUploaded;
}
protected abstract void FileUploadOnFileUploaded(object sender, FileUploadedEventArgs fileUploadedEventArgs);
}
我在 Define 方法中设置的所有内容都可以正常工作,扩展过滤器除外。我究竟做错了什么?还有其他我应该设置这个属性的时刻吗?