This is a migrated thread and some comments may be shown as answers.

Set default values for Upload in base class

0 Answers 100 Views
Upload (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Thiago
Top achievements
Rank 1
Thiago asked on 11 Apr 2013, 04:45 PM

I have a few web forms that proccess excel files, so in order to make this easier, I have a base class like this:

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);
}

Everything i'm setting in the Define method is working, except the extension filter. What am I doing wrong? is there another moment that I shoud set this property?

No answers yet. Maybe you can help?

Tags
Upload (Obsolete)
Asked by
Thiago
Top achievements
Rank 1
Share this question
or