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

RadUpload in RadListView itemtemplate

1 Answer 71 Views
Upload (Obsolete)
This is a migrated thread and some comments may be shown as answers.
suhas Yalgude
Top achievements
Rank 1
suhas Yalgude asked on 04 Jan 2012, 08:41 AM
Hi,

I am using RadUpload in RadListView itemtemplate. OnClientFileSelected of radupload i am setting filename to textbox and then calling blur().

function ImageFileSelected(radUpload, eventArgs) {
        var input = eventArgs.get_fileInputField().value;
        document.getElementById('txtHSPortraitBackground_text').focus();
        $find("txtHSPortraitBackground").set_value(input.substring(input.lastIndexOf('\\') + 1));
        document.getElementById('txtHSPortraitBackground_text').blur();
    }

this causes textchanged event of textbox.

protected void txtHSPortraitBackground_TextChanged(object sender, EventArgs e)
        {
            RadListViewDataItem item = rlvWebClip.Items[0];
            RadBinaryImage RadBinaryImageUP = ((RadBinaryImage)item.FindControl("RadBinaryImageUP"));
            RadUpload rulHSPortraitBackground = ((RadUpload)item.FindControl("rulHSPortraitBackground"));

            RadBinaryImageUP.DataValue = GetFileDataInByte(rulHSPortraitBackground);
        }

Here the issue is that the uploadedfiles.count is always 0. I am not able to find out why. So please help me.

1 Answer, 1 is accepted

Sort by
0
Dimitar Terziev
Telerik team
answered on 04 Jan 2012, 05:16 PM
Hello Suhas,

Could you clarify whether your RadListView is ajaxified or not? If you are using Ajax, then you should disable it when uploading files since the RadUpload could not upload files via Ajax. Another approach would be to use RadAsyncUpload control instead.

All the best,
Dimitar Terziev
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
Tags
Upload (Obsolete)
Asked by
suhas Yalgude
Top achievements
Rank 1
Answers by
Dimitar Terziev
Telerik team
Share this question
or