我的页面中有Ajax手风琴。我从一个工作正常的数据集中绑定数据,但是当点击手风琴内的按钮时,我需要在选定的手风琴中获取值。 #
但单击按钮时,onclick事件不会触发。
我的.aspx代码。
<cc1:Accordion ID="accRcvDetails" runat="server" SelectedIndex="-1" ContentCssClass="accordion-content" RequireOpenedPane="false" HeaderCssClass="accordion-header" HeaderSelectedCssClass="accordionSelected">
<HeaderTemplate>
</HeaderTemplate>
<ContentTemplate>
<asp:Button ID="btnSave" CssClass="searchbutton Accbtnsave" runat="server" CommandName="Save" Text="Save" />
</ContentTemplate>
我的.CS
public void accRcvDetails_ItemDataBound(object sender, AccordionItemEventArgs e)
{
if (e.ItemType == AjaxControlToolkit.AccordionItemType.Content)
{
Button clickMe = new Button();
clickMe = e.AccordionItem.FindControl("button") as Button;
if (clickMe == null) return;
// to the button's Click event
clickMe.Click += new EventHandler(OnClickMeClicked);
}
}
public void OnClickMeClicked(object sender, EventArgs e)
{
}
单击手风琴窗格内的按钮
时,OnClickMeClicked事件未触发