Check Filesize Clientsite - CustomValidator

Thread is closed for posting
3 posts, 0 answers
  1. Dirk Eberhardt
    Dirk Eberhardt avatar
    18 posts
    Member since:
    Jul 2009

    Posted 12 Jan 2010 Link to this post

    Hello,
    I readed this article about checking the filesize on clientsite: http://www.telerik.com/help/aspnet-ajax/upload_howtoclientfilesize.html

    Now I customized this code for my project:

    <script type="text/javascript"
     function checkUploadedFilesSize(progressArea, args) 
     { 
       if (!progressArea.confirmed && 
           args.get_progressData().RadUpload.RequestSize > 10485760) 
         { 
           progressArea.cancelRequest();    
         } 
      } 
     
    </script> 

    It work's, but how can I set a custom validator to "false" after I canceld the request to show the user an error message??

    My cumstom validator looks like this:
    <asp:CustomValidator  
      ID="checksizevalidator" runat="server" 
      Display="Dynamic"
    The total size of the selected files is more than the limit. 
    </asp:CustomValidator> 

    Thanks in advance for your help.

    Regards
    Dirk





  2. Genady Sergeev
    Admin
    Genady Sergeev avatar
    1600 posts

    Posted 13 Jan 2010 Link to this post

    Hi Dirk Eberhardt,

    I have prepared a sample project that demonstrates how this can be done. All in all the idea is to manually show the validator, since it won't pay attention to the IsValid property being changed after submit.

    Sincerely yours,
    Genady Sergeev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. Dirk Eberhardt
    Dirk Eberhardt avatar
    18 posts
    Member since:
    Jul 2009

    Posted 15 Jan 2010 Link to this post

    With the help of the support team, now it works.

    If someone want to know how to do that, please write me a message.

    Regards,
    Dirk
Back to Top