Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/263.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# ASP.NET的更新面板内未触发按钮单击事件_C#_Asp.net_Updatepanel - Fatal编程技术网

C# ASP.NET的更新面板内未触发按钮单击事件

C# ASP.NET的更新面板内未触发按钮单击事件,c#,asp.net,updatepanel,C#,Asp.net,Updatepanel,当我单击第一个按钮时,更新面板中有两个按钮,因此回发正在工作,但当我单击另一个按钮时,回发根本没有发生。 我得到了java脚本错误。 而且我也不想使用自动回发触发器。而且不能将按钮保持在更新面板之外。 错误消息 错误:Sys.WebForms.PageRequestManagerServerErrorException:在服务器上处理请求时发生未知错误。从服务器返回的状态代码为:401 ASPX代码: <asp:ScriptManager ID="scriptmanager" runat=

当我单击第一个按钮时,更新面板中有两个按钮,因此回发正在工作,但当我单击另一个按钮时,回发根本没有发生。 我得到了java脚本错误。 而且我也不想使用自动回发触发器。而且不能将按钮保持在更新面板之外。 错误消息

错误:Sys.WebForms.PageRequestManagerServerErrorException:在服务器上处理请求时发生未知错误。从服务器返回的状态代码为:401

ASPX代码:

<asp:ScriptManager ID="scriptmanager" runat="server" EnablePageMethods="true">
</asp:ScriptManager>
<asp:UpdatePanel ID="upMFHoldings" runat="server">
    <ContentTemplate>
        <div id="divConditional" runat="server" class="row " style="margin-left: 5%; margin-bottom: 0.5%;
            margin-right: 5%; padding-bottom: 0.5%;">
      <div class="col-md-12 col-xs-12 col-sm-12" style="margin-bottom: 1%">
                <div class="col-md-1" style="text-align: right; padding-top: 3px">
                    Account
                </div>
                <div class="col-md-3">
                    <asp:DropDownList ID="ddlPortfolio" runat="server" CssClass="form-control input-sm">
                    </asp:DropDownList>
                </div>
                <div class="col-md-3">
                    <asp:Button ID="btnUnitHolding" runat="server" Text="GO" CssClass="btn btn-primary btn-primary"
                        OnClick="btnUnitHolding_Click" />
                    <asp:Label ID="lblPickDate" Text="" runat="server" CssClass="FieldName" Visible="false"> </asp:Label>
                </div>
                <div style="float: right">
                    <asp:ImageButton Visible="false" ID="btnExport" ImageUrl="~/App_Themes/Maroon/Images/Export_Excel.png"
                        runat="server" AlternateText="Excel" ToolTip="Export To Excel" OnClick="btnExportFilteredData_OnClick"
                       Height="25px" Width="29px"></asp:ImageButton>
                </div>
            </div>
 <div id="Div1" class="row" style="margin-left: 5%; margin-right: 3%; background-color: #2480C7;"
            visible="false" runat="server">
            <telerik:RadGrid ID="rgUnitHolding" runat="server" GridLines="None" AllowPaging="True"
                PageSize="3" AllowSorting="True" AutoGenerateColumns="False" ShowStatusBar="true"
                AllowAutomaticDeletes="false" AllowAutomaticInserts="false" AllowAutomaticUpdates="false"
                HorizontalAlign="NotSet" CellPadding="15" OnNeedDataSource="rgUnitHolding_OnNeedDataSource"
                OnItemCommand="rgUnitHolding_OnItemCommand" OnItemDataBound="rgUnitHolding_ItemDataBound">
                <MasterTableView CommandItemDisplay="None" DataKeyNames="MFNPId,AccountId,AMCCode,SchemeCode"
                    AllowCustomSorting="true">
                    <Columns>
                        <telerik:GridTemplateColumn>
                            <ItemTemplate>
 <%-- Some Grid Columns are there --%>
   </ItemTemplate>
                        </telerik:GridTemplateColumn>
    </Columns>
                </MasterTableView>
  </telerik:RadGrid>
        </div>
      <asp:HiddenField ID="hdnAccount" runat="server" Value="0" />
    </ContentTemplate>
    <Triggers>

    </Triggers>
</asp:UpdatePanel>

此异常通常与更新面板触发器相关。以下链接对此有一定的解决方案


我也有类似的问题。我将Updatepanel中的UpdateMode属性设置为“Conditional”,然后添加了正确的触发器

    <asp:Button ID="Button1" runat="server" Text="Button" />
    <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
        <Triggers>
            <asp:AsyncPostBackTrigger ControlID="Button1" EventName="Click">
            </asp:AsyncPostBackTrigger>
        </Triggers>
    </asp:UpdatePanel>


401未经授权。但是你真的应该显示相关的代码(aspx和codebehind)。任何解决方案??现在您可以检查我是否已更新问题谢谢您的回复,但是,上面的链接对我没有帮助。因为我没有在UpdatePanel或Button Click中使用任何HttpModule。我遇到了类似的问题。我将Updatepanel中的UpdateMode属性设置为“Conditional”,然后添加了正确的触发器
    <asp:Button ID="Button1" runat="server" Text="Button" />
    <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
        <Triggers>
            <asp:AsyncPostBackTrigger ControlID="Button1" EventName="Click">
            </asp:AsyncPostBackTrigger>
        </Triggers>
    </asp:UpdatePanel>