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

Check Filesize Clientsite - CustomValidator

2 Answers 61 Views
Upload (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Dirk Eberhardt
Top achievements
Rank 1
Dirk Eberhardt asked on 12 Jan 2010, 03:54 PM
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 Answers, 1 is accepted

Sort by
0
Genady Sergeev
Telerik team
answered on 13 Jan 2010, 12:35 PM
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.
0
Dirk Eberhardt
Top achievements
Rank 1
answered on 15 Jan 2010, 07:48 AM
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
Tags
Upload (Obsolete)
Asked by
Dirk Eberhardt
Top achievements
Rank 1
Answers by
Genady Sergeev
Telerik team
Dirk Eberhardt
Top achievements
Rank 1
Share this question
or