As you know that ASP.Net File Upload control can not be placed in multi view. If you put your file upload inside the multi view. You will lost your content when the multi view change the active view.
But the good news is there is Open source control called File Upload Ajax which in V1.2 can be placed inside Wizard, Multi View, invisible Panels, hidden divs, etc.
Download the control @ http://www.codeplex.com/fileuploadajax/Release/ProjectReleases.aspx?ReleaseId=8061
And try this.
- Add your FUA in your project
- Register in your page or in web.config
- Add your Update panel, Multiview and file upload
- Add Code behind code
<%@ Register Assembly="FUA" Namespace="Subgurim.Controles" TagPrefix="cc1" %>
<asp:UpdatePanel ID="up" runat="server">
<ContentTemplate>
<asp:MultiView ID="multiPages" runat="server" ActiveViewIndex="0">
<asp:View ID="v1" runat="server">
</asp:View>
<asp:View ID="v2" runat="server">
upload:
<cc1:FileUploaderAJAX ID="FileUploaderAJAX1" runat="server" MaxFiles="1" Directory_CreateIfNotExists="true" File_RenameIfAlreadyExists="true"/>
</asp:View>
</asp:MultiView>
</ContentTemplate>
</asp:UpdatePanel>
protected void Page_Load(object sender, EventArgs e)
{
if (FileUploaderAJAX1.IsPosting)
{
HttpPostedFileAJAX pf = FileUploaderAJAX1.PostedFile;
FileUploaderAJAX1.SaveAs("~/upload", pf.FileName);
}
}