English 中文(简体)
ajaxtabcontainer 完全后退, 如何控制它
原标题:ajaxtabcontainer do full postback, how to controll it

我在主页中使用脚本管理器, 因为每个内容页面都要被校正 。

在内容页面中,我使用 UpdatePazel ,一切都很好,但如果我使用 TabCOntainer 的内容页面,每次我从一个制表符转到另一个制表符时,页面都是完整后退。

这里我注意到一件事,当我从主页中删除 ScriptManager 并在 contentPage 中使用时,那么 tabtainer 就能正常工作。

这种类型的状况有什么可能的解决办法?

<强 > MASTERPAGE

  <!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 id="Head1" runat="server">
 </head>

 <body>

   <form id="form1" runat="server">

  <asp:ScriptManager ID="ScriptManager1" runat="server">
   </asp:ScriptManager>

 <asp:UpdatePanel ID="UpdatePanel_Register" runat="server">
     <ContentTemplate>
        //Update Panel work at Master Page
      </ContentTemplate>
</asp:UpdatePanel>


           <asp:ContentPlaceHolder ID="showcase" runat="server">

            </asp:ContentPlaceHolder>

< 坚固 > COONTPAGE

 <%@ Page Title="" Language="C#" MasterPageFile="~/MasterDashBoard.master" AutoEventWireup="true"
CodeFile="messages.aspx.cs" Inherits="messages" %>

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


  <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">

   <asp:UpdatePanel ID="UpdatePanel_msg" runat="server" >

      <ContentTemplate>

        <cc1:TabContainer ID="TabContainer1" runat="server" ActiveTabIndex="0" AutoPostBack="True"
                        OnActiveTabChanged="TabContainer1_ActiveTabChanged">

           <cc1:TabPanel runat="server" HeaderText="TabPanel1" ID="TabPanel1" ToolTip="Compose Message">

               <HeaderTemplate>
                                Compose
               </HeaderTemplate>

               <ContentTemplate>
                        Some Work

               </ContentTemplate>

   </cc1:TabPanel>

       <cc1:TabPanel runat="server" HeaderText="TabPanel2" ID="TabPanel2">

                <HeaderTemplate>
                                inbox
                </HeaderTemplate>

                 <ContentTemplate>
            SOme Work
                 </ContentTemplate>
        </cc1:TabPanel>

      </cc1:TabContainer>
    </ContentTemplate>
 </asp:UpdatePanel>

最佳回答

我有一个类似的使用案例,并且设置了 UptidateMode="Conditional" , ChildsAsstriggers=" true" , 并使用 AsyncPostbackTrigggers ApidalTabChanged 事件处理器。 在 AvientiveTabChanged 事件处理器i 中, 在更新版上, 并最后在 NewddatePanel 上, i 转换包含控件的可见度并调用 < a href=> http://msdn. microft.com/en-us/library/system.web.u.upddpan.up.aspate.aspate.aspt.asp >.asp >.asp@asp > asp > asp@asp@asp > res@asp > resd>.asp > res.aspd > 更新版, 更新版, 更新版中, 更新版

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <asp:ScriptManagerProxy ID="ScriptManagerProxy1" runat="server">
    </asp:ScriptManagerProxy>
    <div>
        <asp:UpdatePanel ID="UpdTabContainer" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="true">
            <ContentTemplate>
                <asp:TabContainer ID="TabContainer1" runat="server" AutoPostBack="true">
                    <asp:TabPanel ID="TabDeliveryControl" runat="server" HeaderText="Delivery-Control">
                        <HeaderTemplate>
                            <asp:Panel ID="PnlTabDeliveryControl" runat="server" ToolTip="Delivery-Control">
                                Delivery-Control
                            </asp:Panel>
                        </HeaderTemplate>
                        <ContentTemplate>
                            <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
                                <ContentTemplate>
                                    <SVCS:SVCSDeliveryControl id="SVCSDeliveryControl" runat="server" Visible="false" />
                                </ContentTemplate>
                                <Triggers>
                                    <asp:AsyncPostBackTrigger ControlID="TabContainer1" EventName="ActiveTabChanged" />
                                </Triggers>
                            </asp:UpdatePanel>
                        </ContentTemplate>
                    </asp:TabPanel>
                    <asp:TabPanel ID="TabRepair" runat="server" HeaderText="Repair-Area" >
                        <HeaderTemplate>
                            <asp:Panel ID="PnlTabRepair" runat="server" ToolTip="Repair-Area">
                                Repair-Area
                            </asp:Panel>
                        </HeaderTemplate>
                        <ContentTemplate>
                            <asp:UpdatePanel ID="UpdatePanel4" runat="server" UpdateMode="Conditional">
                                <ContentTemplate>
                                    <SVCS:SVCSRepair id="SVCSRepair" runat="server" Visible="false" />
                                </ContentTemplate>
                                <Triggers>
                                    <asp:AsyncPostBackTrigger ControlID="TabContainer1" EventName="ActiveTabChanged" />
                                </Triggers>
                            </asp:UpdatePanel>
                        </ContentTemplate>
                    </asp:TabPanel>
                    <asp:TabPanel ID="TabShipping" runat="server" HeaderText="Shipping" Visible="false">
                        <HeaderTemplate>
                            <asp:Panel ID="PnlTabShipping" runat="server" ToolTip="Shipping">
                                Shipping
                            </asp:Panel>
                        </HeaderTemplate>
                        <ContentTemplate>
                            <asp:UpdatePanel ID="UpdatePanel5" runat="server" UpdateMode="Conditional">
                                <ContentTemplate>
                                    <SVCS:SVCSShipping id="SVCSShipping" runat="server" Visible="false" />
                                </ContentTemplate>
                                <Triggers>
                                    <asp:AsyncPostBackTrigger ControlID="TabContainer1" EventName="ActiveTabChanged" />
                                </Triggers>
                            </asp:UpdatePanel>
                        </ContentTemplate>
                    </asp:TabPanel>
                </asp:TabContainer>
            </ContentTemplate>
        </asp:UpdatePanel>
    </div>
</asp:Content>
问题回答

暂无回答




相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Transaction handling with TransactionScope

I am implementing Transaction using TransactionScope with the help this MSDN article http://msdn.microsoft.com/en-us/library/system.transactions.transactionscope.aspx I just want to confirm that is ...

System.Web.Mvc.Controller Initialize

i have the following base controller... public class BaseController : Controller { protected override void Initialize(System.Web.Routing.RequestContext requestContext) { if (...

Microsoft.Contracts namespace

For what it is necessary Microsoft.Contracts namespace in asp.net? I mean, in what cases I could write using Microsoft.Contracts;?

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!