UserControl无法在RadAjaxPanel

时间:2016-05-03 05:54:30

标签: c# asp.net ajax telerik

最近我遇到了一个奇怪的问题,我的usercontrols,当有两个或多个由ajaxToolkit管理时:ModalPopupExtender嵌套在另一个usercontrol中,在RadAjaxPanel中会丢失回发之间的输入值。外部的任何其他控件或用户控件都没有这样的问题,使有问题的用户控件成为父母。

作为我的调试尝试的一个启示,将一个有问题的控件设置为可见的false(并且当它们应该出现在模态弹出窗口中时将其设置为可见)将解决此问题。

这是我的代码:

有问题的控制:

<asp:Panel ID="FileDefinitionEdit" CssClass="sbpopup" style="display:none"  runat="server"    >                                      
<div class="popupholder" style="width:1000px">
  <uc3:FileDefinitionEdit ID="FileDefinitionEditAscx" runat="server"  visible="false"  />
   <div class="popbuttonarea"> 
 <asp:Button ID="Button5"  OnClick="Button5_Click" CssClass="btn btn-primary btn-sm"  runat="server" Text="Insert"  />
    <asp:Button ID="Button6" CssClass="btn btn-primary btn-sm"   OnClick="Button6_Click"   runat="server" Text="Cancel" /></div>
    </div>                              
 </asp:Panel>
 <asp:Panel ID="ConnectionStringEdit" CssClass="sbpopup"  style="display:none"  runat="server"   >
 <div class="popupholder" style="width:1000px">
    <uc2:ConnectionStringEdit ID="ConnectionStringEditAscx" runat="server"   Visible="false"   />
     <div class="popbuttonarea">  
     <asp:Button ID="Button4"  OnClick="Button4_Click" CssClass="btn btn-primary btn-sm"  runat="server" Text="Insert" />
      <asp:Button ID="Button3" CssClass="btn btn-primary btn-sm"   OnClick="Button6_Click"   runat="server" Text="Cancel" /></div>
     </div>                                        
</asp:Panel>    
<asp:Button ID="MPECTRL_Button"  CssClass="hiddenControl"   runat="server" Text="Button" />
<ajaxToolkit:ModalPopupExtender  ID="PopupInsert_ModalPopupExtender" runat="server" TargetControlID="MPECTRL_Button"    PopupControlID="ConnectionStringEdit"      /> 

有问题的控件的父控制:

<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ProcessesControl.ascx.cs"   Inherits="BizData.Perspective.DataGovernor.Controls.ProcessesControl" %>
<%@ Register Src="ParametersControl.ascx" TagName="ParametersControl" TagPrefix="uc1" %>
<%@ Register Src="ConnectionStringEdit.ascx" TagName="ConnectionStringEdit" TagPrefix="uc2" %>
<%@ Register Src="FileDefinitionEdit.ascx" TagName="FileDefinitionEdit" TagPrefix="uc3" %> 
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit"  %>

母版页:

//Header
....
<body style="margin: 0px; height: 100%; overflow: hidden;">
<form id="Form1" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
     </telerik:RadScriptManager>
     <telerik:RadStyleSheetManager ID="RadStyleSheetManager1" runat="server" />
     <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" DefaultLoadingPanelID="RadAjaxLoadingPanel2">
         <AjaxSettings>
             <telerik:AjaxSetting AjaxControlID="RadAjaxPanel1">
                 <UpdatedControls>
                     <telerik:AjaxUpdatedControl ControlID="RadAjaxPanel1" LoadingPanelID="RadAjaxLoadingPanel2" />
                 </UpdatedControls>
            </telerik:AjaxSetting>
         </AjaxSettings>
     </telerik:RadAjaxManager>
  //Where all contents and controls reside:
     <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" Width="100%" Height="100%">
 <telerik:RadSplitter ID="RadSplitter1" runat="server" Orientation="Horizontal" BorderStyle="None"
            BorderSize="0" LiveResize="true" Width="100%" Height="100%" RegisterWithScriptManager="true"
             RenderMode="Lightweight" >
<telerik:RadPane ID="rpHeader" runat="server" BorderStyle="None" BorderWidth="0"
                 Height="45px" CssClass="visibleOverflow">
....
 </telerik:RadPane>
       </telerik:RadSplitter>
     </telerik:RadAjaxPanel>   
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel2" runat="server" Transparency="10">
        <div class="loading" style="text-align: left; padding-top: 45px; padding-left: 98%">
             <asp:Image ID="Image2" runat="server" ImageUrl="images/loading1.gif" AlternateText="loading.."
                Width="16px" Height="16px" />
        </div>
    </telerik:RadAjaxLoadingPanel>
 ....
 //Datasources and footer

我也很幸运地把控件放在RadAjaxPanel中并且问题仍然存在。

无法使本机UpdatePanel工作。出现错误&#34;找不到ID为#34的UpdatePanel;因为所有内容都已封装在母版页上的RadAjaxPanel中,从而导致冲突。

我猜测太多用户控件会超过某种类型的viewstate容量,导致它们的输入值在回发之间被截断。

有什么想法吗?

0 个答案:

没有答案