문제

in the aspx file:

<asp:LinkButton ID="lnkbutton1" runat="server" Text="foo bar" OnClick="lnkbutton1_Click"></asp:LinkButton>

<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
some control...
</ContentTemplate>
   <Triggers>
     <asp:AsyncPostBackTrigger ControlID="lnkbutton1" EventName="Click" />
</Triggers>
</asp:UpdatePanel>

in the code behind:

protected void lnkbutton1_Click(object sender, EventArgs e)
{
    lnkbutton1.CssClass = "activeAnchor";
}

Css class is not changing unless I remove the link button from the trigger(and have a full page post back)

Any help?

도움이 되었습니까?

해결책

Your linkbutton is outside the update panel.. it won;t update... its not supposed to.. Move it inside your update panel.

Your update panel is not mean to house the button that should update the controls, its actually meant to house the controls and the button.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top