On my working projects, I don't specify the OnFileValidating in the control but ONLY in the OnInit like so
- protected override void OnInit(EventArgs e)
- {
- base.OnInit(e);
- SampleUtil.SetPageCache();
-
- Uploader1.FileValidating += new UploaderEventHandler(Uploader_FileValidating);
- }
SampleUtil.SetPageCache is a static class supplied by CuteWebUI in the ajaxuploader samples.
And then, I make sure I Cast the Uploader control again in the Event method like so.
- void Uploader_FileValidating(object sender, UploaderEventArgs args)
- {
- Uploader uploader = (Uploader)sender;
-
- }
Greg