2012-08-14 75 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" /> 
相關問題