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

UploadedFiles.Count returns 0

1 Answer 55 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Kevin
Top achievements
Rank 1
Kevin asked on 11 Aug 2010, 03:01 PM

Hello,
I'm using a RadUpload control.
I have a Panel control that includes RadUpload and it's Submit button (WebControls.Button).
Depends on some conditions I'm playing with visibility of the Panel.
When the panel is visible, I can choose file to upload, then when I press Submit button - UploadedFiles.Count shows 0 files.
I'm using
RadAjaxManager to make my page load different parts of my page smoothly and of cause, I use it for the Panel (described above).

It works fine if I take the Submit button out from the panel and make it always visible, but unfortunately that‘s not the case.

When I’m using RadAjaxManager to “load” the Submit button, it stops read data from RadUpload control.

Can you please help me out and let me know what is the work around this problem???

 

Thanks,

Kevin

1 Answer, 1 is accepted

Sort by
0
Accepted
Cori
Top achievements
Rank 2
answered on 11 Aug 2010, 05:27 PM
Hello Kevin,

The reason it shows no UploadedFiles is because the button is performing an ajax request. To disable ajax when the button is pressed, you'll need to do something like this:

<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
<script type="text/javascript">
   function RequestStart(sender, eventArgs) {
       var eventTarget = eventArgs.get_eventTarget();
       if (eventTarget.indexOf("Button1")!= -1) {
           eventArgs.set_enableAjax(false);
       }
   }
</script>
</telerik:RadCodeBlock>

Where I wrote "Button1" you should add the name of your button and then attach this event to you RadAjaxManager's OnRequestStart client event.

I hope that helps.
Tags
Ajax
Asked by
Kevin
Top achievements
Rank 1
Answers by
Cori
Top achievements
Rank 2
Share this question
or