简体   繁体   中英

How to use UpdatePanel with TabContainer and FileUpload?

I have 2 tabs inside an UpdatePanel and a button inside Tab2

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>

<asp:UpdatePanel ID="upd" runat="server">
    <ContentTemplate>

<asp:TabContainer ID="tab" runat="server" AutoPostBack="true">
    <asp:TabPanel HeaderText="Tab1" runat="server">
    </asp:TabPanel>
    <asp:TabPanel HeaderText="Tab2" runat="server">

        <asp:LinkButton ID="btn" runat="server" />

    </asp:TabPanel>
</asp:TabContainer>

    </ContentTemplate>
</asp:UpdatePanel>

I want the tabs to change without reloading the entire page, so the UpdatePanel works fine. But on the second tab I have a file upload and the button btn is supposed to submit this file.

How can I do a full postback when clicking btn keeping a partial postback when changing tabs?

可能您可以在OnClick事件中使用Response.Redirect到同一页面。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM