StevieB
StevieB

Reputation: 6533

Linkbutton Click not working in update panel

<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" />

But for some reason when I click on the button nothing happens, If I remove the update panel the button works fine.

Upvotes: 3

Views: 8568

Answers (1)

Waqar Janjua
Waqar Janjua

Reputation: 6123

The problem is that you are using AsyncPostBackTrigger instead of PostbackTrigger. AsyncPostBackTrigger is used when the control is outside the update panel, your linkbutton is present inside the update panel so you should use PostBackTrigger.

  <asp:PostBackTrigger ControlID="SearchBtn" />

Upvotes: 5

Related Questions