AsyncUpload can't access addtional field on server side, always return null value

4 posts, 1 answers
  1. David
    David avatar
    4 posts
    Member since:
    Oct 2010

    Posted 19 Aug 2011 Link to this post

    I tried to put AsyncUpload into one of my usercontrols, but I always  got null exception error when I tried to get addtional field at code behind. At first I thought that's user control's problem, but  later on, even I put the exact the same code as demo into my test page, I got the same null exception error  on this line :


    Anyone else got same issue as I got? Pls take a look whenever you have time, really appreciate.

    <telerik:RadScriptManager ID="ScriptManager1" runat="server" />
        <telerik:RadAsyncUpload runat="server" ID="RadAsyncUpload1" OnClientFileUploaded="onClientFileUploaded">
        <telerik:RadButton ID="saveradbtn" runat="server" OnClick="saveradbtn_Click" Text="save image" />
        <asp:Label ID="labelNoResults" runat="server" Visible="True">No uploaded files</asp:Label>
        <asp:Repeater runat="server" ID="Repeater1">
                <span style="font-weight: normal; font-size: 10px; color: black; position: relative">
                    File info: <%#((Telerik.Web.UI.UploadedFile)Container.DataItem).GetFieldValue("TextBox").ToString()%>,<br />
                    File name: <%# DataBinder.Eval(Container.DataItem, "FileName").ToString() %>,<br />
                    File size: <%# DataBinder.Eval(Container.DataItem, "ContentLength").ToString() %><br />
                    <br />
                    <br />
        <script type="text/javascript">
            var $ = $telerik.$;
            function onClientFileUploaded(radAsyncUpload, args) {
                var $row = $(args.get_row());
                var inputName = radAsyncUpload.getID("TextBox");
                var inputType = "text";
                var inputID = inputName;
                var input = createInput(inputType, inputID, inputName);
                var label = createLabel(inputID);
            function createInput(inputType, inputID, inputName) {
                var input = '<input type="' + inputType + '" id="' + inputID + '" name="' + inputName + '" />';
                return input;
            function createLabel(forArrt) {
                var label = '<label for=' + forArrt + '>File info: </label>';
                return label;
    --------------code behind-------------------------------------
     protected void saveradbtn_Click(object sender, EventArgs e)
                if (RadAsyncUpload1.UploadedFiles.Count > 0)
                    labelNoResults.Visible = false;
                    Repeater1.Visible = true;
                    Repeater1.DataSource = RadAsyncUpload1.UploadedFiles;
                    labelNoResults.Visible = true;
                    Repeater1.Visible = false;
  2. David
    David avatar
    4 posts
    Member since:
    Oct 2010

    Posted 19 Aug 2011 Link to this post

    anyone has a solution for this?
  3. DevCraft R3 2016 release webinar banner
  4. David
    David avatar
    4 posts
    Member since:
    Oct 2010

    Posted 19 Aug 2011 Link to this post

    hi Guys, the problem has been solved.. That's my mistake, I should use the newest telerik.web.UI.dll to replace the previous one.. 

    What a stupid mistake I made... pls close the post. 

  5. Answer
    Peter Filipov
    Peter Filipov avatar
    1028 posts

    Posted 23 Aug 2011 Link to this post

    Hello David,

    We had some issues with the Additional fields demo. Please take a look at the attached example. The demo will be working correct in all cases for the next service pack.

    Best wishes,
    Peter Filipov
    the Telerik team

    Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

Back to Top