Hi,
I have a multiview control inside a update panel. In my sample page, the first view has just a button(In real time has lots of controls). On clicking this button I show the second view which has a asp file upload and a button. When I click the file upload button, I am unable to get that file in the server side. When I dont have multiview, everything works fine since I have postback triggers in the form. I am really confused why setting the active view index of the multiview control is causing the issue..Please help... Here is the code what I have
<
asp:UpdatePanel ID="upd" runat="server">
<ContentTemplate>
<asp:MultiView runat="server" ID="vwFile">
<asp:View ID="view1" runat="server">
<asp:Button ID="Button1" CausesValidation="true" runat="server" Text="Test" OnClick="Button1_Click" />
</asp:View>
<asp:View ID="view2" runat="server">
<asp:FileUpload ID="importFile" runat="server" Width="300" Height="18" />
<asp:Button ID="bbFileUpload" CausesValidation="true" runat="server" Text="Upload" OnClick="bbFileUpload_Click" />
</asp:View>
</asp:MultiView>
</ContentTemplate>
<Triggers>
<asp:PostBackTrigger ControlID="bbFileUpload" />
</Triggers>
</asp:UpdatePanel>
Code behind
Protected Sub bbFileUpload_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles bbFileUpload.Click
Dim result As Boolean = importFile.HasFile
End SubProtected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs)
vwFile.ActiveViewIndex = 1
End SubProtected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
vwFile.ActiveViewIndex = 0
End Sub