Adding extra information causes my upload control to lose InitialFileInputsCount

Thread is closed for posting
2 posts, 0 answers
  1. Shane P
    Shane P avatar
    86 posts
    Member since:
    Sep 2012

    Posted 08 Oct 2008 Link to this post

    Hi everyone,
    I have copied the code from here and the extra field is been added and I can see the value on postback serverside. However my InitialFileInputsCount is been changed from 4 to 2 and I dont know why.

    Can anyone see what is wrong?

    Here is my code.
        <telerik:RadUpload ID="RadUpload1" Runat="server" InitialFileInputsCount="4" MaxFileInputsCount="4"   
     ControlObjectsVisibility="None"  > 
     <script type="text/javascript">  
         var numberOfCustomFields = 0;  
         function OnClientAddedHandler(sender, eventArgs) {  
             var inputRow = eventArgs.get_row();  
             var uList = inputRow.parentNode;  
             var count = 0;  
             // add a new row for a Title field  
             newRow = document.createElement("li");  
             uList.insertBefore(newRow, inputRow);  
             var label = document.createElement("span");  
             label.innerHTML = "Name ";  
    = 12;  
             input = document.createElement("input");  
             input.type = "text";  
    = = sender.getID("ImageName");  
             //add a File label in front of the file input  
             var fileInputSpan = inputRow.getElementsByTagName("span")[0];  
             label = document.createElement("span");  
             label.innerHTML = "File ";  
    = 12;  
             inputRow.insertBefore(label, fileInputSpan);  
             numberOfCustomFields = count;  

    Thank you
  2. Veselin Vasilev
    Veselin Vasilev avatar
    2992 posts

    Posted 13 Oct 2008 Link to this post

    Hi Shane,

    The reason for this is that the MaxFileInputsCount property counts the number of <LI> elements of the UL list of RadUpload so you need to add <LI> elements with attention. Check the online example for another approach.

    All the best,
    Veselin Vasilev
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Back to Top