I have a AjaxFileUpload, when outside a wizard control, it works fine.
However, when I put it into a wizard step control, other code unchanged.
Whenever I upload a file, the progress bar will stuck at 80%, 85% -- some random number, no file is uploaded.
Worst of all, my system is windows xp, I use visual studio express 2010 to display the page, I found that the folder that I tried to
AjaxToolControl1.SaveAs() is access denied to me, I can not take ownership of that folder. There is no security sub menu in right-click menu of the folder. I tried to change user permission of its parent folder, and reset all permission in child folder, still access denied.
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Test.Default" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head runat="server"><title></title></head><body><form id="form1" runat="server"><div><asp:ScriptManager ID="scriptmanger" runat="server"></asp:ScriptManager><asp:Wizard ID="Wizard1" runat="server"><WizardSteps><asp:WizardStep ID="WizardStep1" runat="server" Title="Step 1"></asp:WizardStep><asp:WizardStep ID="WizardStep2" runat="server" Title="Step 2"><ajaxToolkit:AjaxFileUpload ID="AjaxFileUpload1"
MaximumNumberOfFiles="1"
runat="server" onuploadcomplete="AjaxFileUpload1_UploadComplete"/></asp:WizardStep></WizardSteps></asp:Wizard></div></form></body></html>using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.Common;
using System.Data.Odbc;
using System.Data;
using System.Collections;
using System.IO;
namespace Test
{
public partial class Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
}
return;
}
protected void AjaxFileUpload1_UploadComplete(object sender, AjaxControlToolkit.AjaxFileUploadEventArgs e)
{
string path = @"D:\temp\test1\";
if (!Directory.Exists(path))
{
Directory.CreateDirectory(path);
}
AjaxFileUpload1.SaveAs(path + e.FileName);
}
}
}