How do you set validation options for the Uploader programatically?

Last post 01-14-2013, 11:02 AM by AtomP. 2 replies.
Sort Posts: Previous Next
  •  01-11-2013, 4:38 PM 76629

    How do you set validation options for the Uploader programatically?

    I need to set different file type validation according to a previous selection by the user.
  •  01-14-2013, 8:20 AM 76637 in reply to 76629

    Re: How do you set validation options for the Uploader programatically?

    Hi AtomP,

     

    You can set it programatically in event page load. Like below

     

    1. protected override void OnLoad(EventArgs e)  
    2.    {  
    3.        if (Context.User.Identity.Name == "David")  
    4.        {  
    5.            Uploader1.ValidateOption.AllowedFileExtensions = "jpg,gif";  
    6.        }  
    7.        if (Context.User.Identity.Name == "Mary")  
    8.        {  
    9.            Uploader1.ValidateOption.AllowedFileExtensions = "pdf,txt";  
    10.        }  
    11.        base.OnLoad(e);  
    12.    }  
     

    Regards,

     

    Ken 

  •  01-14-2013, 11:02 AM 76640 in reply to 76637

    Re: How do you set validation options for the Uploader programatically?

    Thanks.
View as RSS news feed in XML