HOW: Uploader in invisible panel

Feb 5, 2009 at 9:39 AM
Hi,

I don't know how this works...

I have 2 update panels. The second one has an invisible panel and inside that panel is the FileUploader.
I show the invisiblre pnael when I press a button.
I'm getting always the message "Please install adobe flash player"

This is the code:

 

<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>

 

 


<
asp:UpdatePanel ID="UpdatePanel1" runat="server">

 

 

<ContentTemplate>

 

 

<asp:Panel ID="panel1" runat="server" Visible="true">

 

 

<asp:TextBox ID="TextBox1" runat="server" TextMode="MultiLine"></asp:TextBox>

 

 

<asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="Button" />

 

 

</asp:Panel>

 

 

</ContentTemplate>

 

 

</asp:UpdatePanel>

 

 

 

<asp:UpdatePanel ID="UpdatePanel2" runat="server">

 

 

<ContentTemplate>

 

 

<asp:Panel ID="panel2" runat="server" Visible="false">

 

 

 

<asp:TextBox ID="Text1" runat="server"></asp:TextBox>

 

 

<fjx:FileUploader ID="FileUploader1" runat="server" UseInsideUpdatePanel="true" MaxFileSize="1MB" MaxFileQueueSize="4MB" AllowedFileTypes="Im genes (jpg, gif):*.jpg;*.jpeg;*.gif">

 

 

<Adapters>

 

 

<fjx:FileSaverAdapter FolderName="Files" OnFileNameDetermining="FileNameDetermining" />

 

<%

--<fjx:ThumbGeneratorAdapter FolderName="Files" Suffix="_thumb" MaximumWidth="200" MaximumHeight="200" /> --%>

 

 

</Adapters>

 

 

</fjx:FileUploader>

 

 

 

</asp:Panel>

 

 

</ContentTemplate>

 

 

</asp:UpdatePanel>



Code behind:

 

 

protected void Button1_Click(object sender, EventArgs e)

 

{

panel1.Visible =

false;

 

panel2.Visible =

true;

 

}

thanks

Coordinator
Feb 5, 2009 at 3:51 PM
Its a little bit more complicated if it is invisible and may require you to write some client side code. The basics are here:


If on the other hand you have a custom client side logic that makes the parent of the uploader invisible or reloads that parent. You can do this:

<script type="text/JavaScript">
// initialize on the page load
InitUploader();

// function called BEFORE ParentDiv is reloaded
function BeforeReload(){
  DisposeUploader();
}

// function called AFTER ParentDiv is reloaded
function AfterReload(){
  InitUploader();
}
</script>
<div id="ParentDiv">
  <fjx:FileUploader ID="FileUploader1" JsFunc_Init="InitUploader" JsFunc_Dispose="DisposeUploader" runat="server">
      <Adapters>
          <fjx:FileSaverAdapter Runat="server" FolderName="UploadFolder" />
      </Adapters>
  </fjx:FileUploader>
</div>
Feb 5, 2009 at 7:37 PM

Sorry for asking but I'm new with this.

Could you make a complete example, because I'm pretty lost....thanks
Coordinator
Feb 6, 2009 at 4:16 PM
Sorry Juanster I am affraid I won't have time these days to go through your code and modify it. Try to make it yourself starting with the exampole I posted. This is a great chance for you to learn to combine client side and server side code in general.