2012-08-14 81 views
3
<div id="TrainingSearchGridContainer" class="mt_20"> 
    <asp:UpdatePanel runat="server" ID="UpdatePanelCountryRegions" UpdateMode="Conditional"> 
        <ContentTemplate> 
&nbsp; 
<asp:DropDownList runat="server" ID="ProductDropDown"></asp:DropDownList> 
<asp:DropDownList runat="server" ID="DateDropDown"></asp:DropDownList> 

<asp:DropDownList runat="server" ID="CountryDropDown" AutoPostBack="True" OnSelectedIndexChanged="LoadRegions"></asp:DropDownList> 
<asp:DropDownList runat="server" ID="StateDropDown"></asp:DropDownList> 
    <asp:LinkButton ID="SearchBtn" runat="server" OnClick="StartSearch"> 
    <span class="blueButton2css3"><span class="btnspan"> 
     <asp:Literal ID="SearchButtonText" runat="server"></asp:Literal></span></span> 
</asp:LinkButton> 
</ContentTemplate> 
    <Triggers> 
<asp:asyncpostbacktrigger controlid="SearchBtn" eventname="Click" /> 

LinkBut​​ton的点击不更新面板

但由于某些原因,当我按一下按钮没有任何工作情况,如果我删除更新面板按钮能正常工作。

回答

5

问题是您正在使用AsyncPostBackTrigger而不是PostbackTrigger。当控件位于更新面板之外时,使用AsyncPostBackTrigger,链接按钮存在于更新面板中,因此您应该使用PostBackTrigger。

<asp:PostBackTrigger ControlID="SearchBtn" /> 
相关问题