Client validation failed?

4 posts, 0 answers
  1. Paul
    Paul avatar
    21 posts
    Member since:
    Sep 2011

    Posted 12 Nov 2014 Link to this post

    Hi all,
       Could someone help me with this issue...  I'm wanting to code the AllowedFileExtensions on the server side or make it dymanic...

    Code behind:
    radAsyncUpload1.AllowedFileExtensions = "doc.docx,pdf.xls".Split(',');

    doesn't seem to be working and it fails on the client end.

    But when I it's in the control like this it work...

    <telerik:RadAsyncUpload ID="radAsyncUpload1" runat="server" AllowedFileExtensions="doc,docx,pdf,xls" />

    based on this http://demos.telerik.com/aspnet-ajax/asyncupload/examples/validation/defaultcs.aspx.
  2. Hristo Valyavicharski
    Admin
    Hristo Valyavicharski avatar
    975 posts

    Posted 17 Nov 2014 Link to this post

    Hi Paul,

    The AllowedFileExtensions property accepts array of strings:

    protected void Page_Load(object sender, EventArgs e)
        {
            RadAsyncUpload1.AllowedFileExtensions = new string[] {".jpg",".png,", ".bmp" };
    }

    I hope this helps.


    Regards,
    Hristo Valyavicharski
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Paul
    Paul avatar
    21 posts
    Member since:
    Sep 2011

    Posted 19 Nov 2014 in reply to Hristo Valyavicharski Link to this post

    I'm still not sure this won't work...

    So what the difference between this "doc,docx,pdf,xls".Split(',')?

    --- OR  if I have it in the web.config ---
      <appSettings>
        <add key="FileExtension" value="doc,docx,pdf,xls"/>
      </appSettings>

    code behind...
                string[] allowedExt = ConfigurationManager.AppSettings["FileExtension"].Split(',');
                radAsyncUpload1.AllowedFileExtensions = allowedExt;

    This that not the same thing? If it is why isn't it working...
  5. Hristo Valyavicharski
    Admin
    Hristo Valyavicharski avatar
    975 posts

    Posted 24 Nov 2014 Link to this post

    It is the same. Should be working:

    http://screencast.com/t/chtGxxGG

    Regards,
    Hristo Valyavicharski
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
Back to Top