2012-07-25 39 views
0

我有一个简单的结构,看起来像一个.NET 4.0的Web应用程序: RootMaster(带的ScriptManager)> ShipmentMaster> ContentPage>的UpdatePanelASP.NET的UpdatePanel打破当ScriptManager的是母版页

UpdatePanel的是最近添加以通过部分页面更新来减少页面闪烁。它不工作。相反,完整的回发/更新正在发生。

我建立这个问题的两个缩小版本,一个(练习1)模仿上面的结构,以及一个(练习2),看起来像: ContentPage(带的ScriptManager)>的UpdatePanel

这似乎关于原始(和Ex1)的Master/ScriptManager安排的事情正在破坏事情,但我不知道是什么。

任何想法?

下面是相关(我想,纠正我,如果错了)的练习1代码:

Root.master,

<body> 
<form id="pageForm" runat="server"> 
    <asp:ScriptManager ID="SiteScriptManager" 
     runat="server" 
     AjaxFrameworkMode="Enabled" 
     EnablePartialRendering="True" 
     LoadScriptsBeforeUI="true" 
     ScriptMode="Release" 
     onasyncpostbackerror="SiteScriptManager_AsyncPostBackError" > 
     <Scripts> 
      <asp:ScriptReference Path="~/Scripts/jquery-1.7.1.min.js" /> 
      <asp:ScriptReference Path="~/Scripts/jquery-ui-1.8.18.custom.min.js" /> 
      <asp:ScriptReference Path="~/Scripts/jquery.tools.min.js" /> 
      <asp:ScriptReference Path="~/Scripts/json2.js" /> 
      <asp:ScriptReference Path="~/Scripts/modernizr.custom.js" /> 
      <asp:ScriptReference Path="~/Scripts/PFF.js" /> 
     </Scripts> 
    </asp:ScriptManager> 
... 
     </form> 
    </body> 
</html> 

WebForm1.aspx的,

<%@ Page Title="" Language="C#" MasterPageFile="~/Master/Root.master" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="Pasha.OTTS.Web.FamiliesFirst.WebForm1" %> 
<asp:Content ID="Content1" ContentPlaceHolderID="RootHeadContentPlaceholder" runat="server"> 
</asp:Content> 
<asp:Content ID="Content2" ContentPlaceHolderID="RootBodyContentPlaceholder" runat="server"> 
<asp:UpdatePanel ID="UpdatePanel1" UpdateMode="Conditional" runat="server"> 
    <Triggers> 
     <asp:AsyncPostBackTrigger ControlID="dpShipments" /> 
    </Triggers> 
    <ContentTemplate> 
     <asp:DataPager ID="dpShipments" runat="server" PagedControlID="lvShipments" PageSize="3" onprerender="dpShipments_PreRender"> 
     <Fields> 
      <asp:NextPreviousPagerField /> 
      <asp:NumericPagerField /> 
     </Fields> 
     </asp:DataPager> 
     <asp:ListView ID="lvShipments" runat="server" onpagepropertieschanging="lvShipments_PagePropertiesChanging"> 
     <LayoutTemplate> 
      <div class="table-wrapper"> 
       <table class="results"> 
        <tr> 
         <th>A</th> 
         <th>B</th> 
        </tr> 
        <tr id="itemPlaceholder" runat="server"></tr> 
       </table> 
      </div> 
     </LayoutTemplate> 
     <ItemTemplate> 
      <tr> 
       <td ><%#Eval("A")%></td> 
       <td ><%#Eval("B")%></td> 
      </tr> 
     </ItemTemplate> 
     </asp:ListView> 
     <asp:Button ID="Button1" runat="server" Text="Button" /> 
     <p>Async: <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label> 
     </p> 
    </ContentTemplate> 
</asp:UpdatePanel> 

回答

0

回答我自己的问题 - 我不知道是谁加的,或者为什么(并且我意识到它没有显示在我原来的帖子中),但是t他攻击代码是在下面一行:

<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Root.master.cs" Inherits="FamiliesFirst.Master.Root" ClientIDMode="Static" %> 

具体做法是:

ClientIDMode="Static" 

去除使问题消失。

相关问题