Welcome Guest Search | Active Topics | Sign In | Register

AjaxUploader - image uploading in background Options
Duane
Posted: Wednesday, July 27, 2011 6:21:21 PM
Rank: Advanced Member
Groups: Member

Joined: 9/4/2007
Posts: 114
The uploader control in the Editor performs an upload of selected files to the specified location in the background ( without postback ). How would one perform the same type of file transfer using the AjaxUploader control by itself?

Thanks
eo_support
Posted: Wednesday, July 27, 2011 7:44:49 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

It does do a post back. The uploader's AutoUpload and AutoPostBack are set true so that the upload automatically starts as soon as user selects a file (AutoUpload), and the uploader automatically posts back as soon as the upload is done (AutoPostBack). That post back is then intercepted by a CallbackPanel which makes it appear that a post back did not occur. You can check the source code for AJAX Uploader -> Upload from ToolBar to see how they are all wired up together.

Thanks!
Duane
Posted: Thursday, July 28, 2011 11:46:57 AM
Rank: Advanced Member
Groups: Member

Joined: 9/4/2007
Posts: 114
Thanks, that seems to work pretty well in IE and Chrome current versions.

Unfortunately, it appears that Firefox 5.0 will not display the content (image) if it is nested in a Panel. There is an <asp:Panel ...> in the markup where the logo is displayed ( normally ). A Label control with it's .Text attribute set to the image tag information is created and added to the Panel during the page load.

The image does not display in Firefox 5.0. Firebug reports : "Failed to load given URL."
IE 9, and Chrome 12.0.742.122 display the image before, and after adding the CallbackPanel.

Is this a known issue in Firefox 5.0? I haven't test older versions of Firefox with this setup.
I am running EO build 8.0.47.2.

Here is how the page layout looks:

Code: HTML/ASPX
<asp:Table>
    <asp:TableRow>
        <asp:TableCell ID="ui_tblcell_SchoolLogoCell" runat="server" Width="260" VerticalAlign="Top" HorizontalAlign="Center">
<eo:CallbackPanel runat="server" ID="ui_cbpnl_CallbackPanel1"             OnExecute="ui_ajx_FileUploader1_FileUploaded">
      <asp:Panel ID="ui_pnl_SchoolLogo" runat="server" ></asp:Panel>
</eo:CallbackPanel>
        </asp:TableCell>
    </asp:TableRow>
</asp:Table>


Here is the code that creates the Label control with image tag and adds it to the Panel:

Code: C#
Label lblSchoolLogo = new Label();
lblSchoolLogo.ID = "ui_lbl_SchoolLogo";
lblSchoolLogo.Attributes.Add("onmouseover", "saveClass=this.className; this.className='SectionHighLight';");
lblSchoolLogo.Attributes.Add("onmouseout", "this.className=saveClass;");

lblSchoolLogo.Attributes.Add("onclick", "javascript:openFileExplorer(this.id, 0, 0)");

lblSchoolLogo.Width = 260;
lblSchoolLogo.CssClass = "SectionNoHighLight";
lblSchoolLogo.Text = School.SchoolLogoFormat;
ui_pnl_SchoolLogo.Controls.Add(lblSchoolLogo);



This is how my page is rendering:


Code: HTML/ASPX
<table id="ctl00_ContentPlaceHolder1_ui_cbpnl_CallbackPanel1" cellspacing="0" cellpadding="0" border="0">
<tbody>
<tr>
<td valign="top">
<div id="ctl00_ContentPlaceHolder1_ui_pnl_SchoolLogo">
<span id="ctl00_ContentPlaceHolder1_ui_lbl_SchoolLogo" class="SectionNoHighLight" style="display:inline-block;width:260px;" onclick="javascript:openFileExplorer(this.id, 0, 0)" onmouseout="this.className=saveClass;" onmouseover="saveClass=this.className; this.className='SectionHighLight';">
<img width="260" alt="" src="\customerimages\e200\CKlogo.gif" style="border-width: 0px; width: 260px;" tabindex="0">
</span>
</div>
</td>
</tr>
</tbody>
</table>



Thanks
eo_support
Posted: Thursday, July 28, 2011 1:18:41 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

You will need to explain how this is related to us first. : ) Also can you provide a full test page so that we can run it here?

Thanks
Duane
Posted: Thursday, July 28, 2011 1:28:01 PM
Rank: Advanced Member
Groups: Member

Joined: 9/4/2007
Posts: 114
My bad, I had inadvertently flipped the forward slashes to backslashes when formatting the path for the image tag.
It only became a problem when I added the CallbackPanel, which is why I thought it was something browser dependent relating to the CallbackPanel.

~~sorry for this post followup. Callback is working.

Thanks
eo_support
Posted: Thursday, July 28, 2011 1:53:52 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
No problem. Let us know if you run into anything else.

Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.