Welcome Guest Search | Active Topics | Sign In | Register

AjaxUploader in MultiView Options
Craig
Posted: Wednesday, July 23, 2008 1:25:02 PM
Rank: Newbie
Groups: Member

Joined: 7/23/2008
Posts: 3
We are using the AjaxUploader from the 2008 EO.Web Controls in a multiview and would like to move the files to the final location using code after the submit button is clicked. The AjaxUploader in the first multiview and the submit button is in the 4th multiview. We had this working with the 2007.2 Web Controls but it no longer works. Any suggestions on what has changed. We can supply a small example if needed. Thank you.
eo_support
Posted: Wednesday, July 23, 2008 1:43:08 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,193
A small example will surely help. So please provide one if you can. Thanks!
Craig
Posted: Wednesday, July 23, 2008 1:49:30 PM
Rank: Newbie
Groups: Member

Joined: 7/23/2008
Posts: 3
Here is a sample using a default.aspx page:

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<%@ Register Assembly="EO.Web" Namespace="EO.Web" TagPrefix="eo" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
</head>
<body>

<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server" />
<div>
<br />
<br />
<br />
<br />
<asp:MultiView runat="server" ActiveViewIndex="0" ID="Tabs">
<asp:View runat="server" ID="View1">
<eo:AJAXUploader ID="AJAXUploader1" runat="server" Width="250px" TempFileLocation="~/upload">
</eo:AJAXUploader>
<br />
<asp:Button ID="Next1" runat="server" Text="Next" OnClick="NextClick" UseSubmitBehavior="false" />
</asp:View>
<asp:View runat="server" ID="View2">
<b>Hello, please continue by clicking 'Next'</b>
<br />
<asp:Button ID="Next2" runat="server" Text="Next" OnClick="NextClick" UseSubmitBehavior="false" />
</asp:View>
<asp:View runat="server" ID="View3">
<b>Hello, please continue by clicking 'Next' again</b>
<br />
<asp:Button ID="Next3" runat="server" Text="Submit" OnClick="MoveFile" UseSubmitBehavior="true" />
</asp:View>
<asp:View runat="server" ID="View4">
<b>THANK YOU! HAVE A NICE DAY!</b>
<br />
</asp:View>
</asp:MultiView>
<br />
</div>
</form>
</body>
</html>


Here is the code from the code behind page:

using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.IO;

public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{

}

protected void MoveFile(object sender, EventArgs e)
{
String path = @"C:\Inetpub\wwwroot\TestUploading\final\Folder4";
if (AJAXUploader1.PostedFiles.Length > 0)
{
Directory.CreateDirectory(path);
}
foreach (EO.Web.AJAXPostedFile file in AJAXUploader1.PostedFiles)
{
//Move the file first
//File.Move(file.TempFileName, @"C:\Inetpub\wwwroot\datarequest\final\" + file.ClientFileName);
File.Move(file.TempFileName, path + "\\" + file.ClientFileName);
}
Tabs.ActiveViewIndex = Tabs.ActiveViewIndex + 1;
}

protected void NextClick(object sender, EventArgs e)
{
int index = Tabs.ActiveViewIndex;
Tabs.ActiveViewIndex = index + 1;

}
}
eo_support
Posted: Wednesday, July 23, 2008 6:15:38 PM
Rank: Administration
Groups: Administration

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

We have posted a new build that fixed this issue. Please check your private message for download locations.

Thanks!
Craig
Posted: Thursday, July 24, 2008 6:57:51 AM
Rank: Newbie
Groups: Member

Joined: 7/23/2008
Posts: 3
The new control works if you only add one file, but as soon as you try to add a second file, you receive an error message.

EO.Web Controls Client Side Debug Message:

AJAXUploader 'AJAXUploader1' has failed due to a server side exception. Click OK to see the exception message.

Once you click OK, you get the following error message:

System.FormatException: Guid should only contain 32 digits with 4 dashes
eo_support
Posted: Thursday, July 24, 2008 7:30:53 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,193
Thanks for letting us know. We will look into it and get back to you as soon as possible.

Thanks
eo_support
Posted: Thursday, July 24, 2008 6:55:20 PM
Rank: Administration
Groups: Administration

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

We have posted a new build that fixed this problem. Please see your private message for download location.

Thanks!
Craig
Posted: Friday, July 25, 2008 6:39:27 AM
Rank: Newbie
Groups: Member

Joined: 7/23/2008
Posts: 3
The new executable seems to be working. Thank you for your help with this issue.


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.