views:

39

answers:

2

I know that such question was has been many times already but I couldn't find any right solution for my problem.

I have MasterPage1 with ScriptManager. There is MasterPage2 in it. In 2-nd MasterPage I placed Control with UpdatePanel. In this UP I placed FileUpload and SubmitButton:

Master1(with SM) <= Master2 <= Control(with FU and But)

I tried to debug method But_OnClick and saw that FU.PostedFile == null.

I tried to place PostBackTrigger to But in UP, I tried to do it from Control's code behind using something like Page.Master.Master.FindControl("ScriptManager") and it doesn't work.

And I even tried to use AjaxControlToolkit...

+1  A: 

You can't use a FileUpload asynchronously.

Have a look at this control which should do what you need.

Rob Stevenson-Leggett
I tried but it cause no effect...
JooLio
Erm, how do you mean "Caused no effect?". Post some code so we can see a bit more clearly what you're doing.
Rob Stevenson-Leggett
+2  A: 

I solve this problem by myself!

First of all:

<form id="mainForm" runat="server" name="mainForm" enctype="multipart/form-data">

Then I use AjaxToolkitControl:

<ajax:AsyncFileUpload runat="server" ID="upload" OnUploadedComplete="UploadComplete" />

And In server event handler UploadComplete I can place the file-saving logic. Bingo!

JooLio