Re: FileValidating event not firing? Please help!

  •  06-18-2009, 12:12 PM

    Re: FileValidating event not firing? Please help!

    On my working projects, I don't specify the OnFileValidating in the control but ONLY in the OnInit like so
    1. protected override void OnInit(EventArgs e)   
    2.     {   
    3.         base.OnInit(e);   
    4.         SampleUtil.SetPageCache();   
    5.   
    6.         Uploader1.FileValidating += new UploaderEventHandler(Uploader_FileValidating);   
    7.     }  
    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.
     
    1. void Uploader_FileValidating(object sender, UploaderEventArgs args)   
    2.     {   
    3.         Uploader uploader = (Uploader)sender;   
    4.         //do your stuff here   
    5.     }  
     
    Greg
View Complete Thread