Asp.net 在UpdatePanel中找不到触发器

Asp.net 在UpdatePanel中找不到触发器,asp.net,Asp.net,我需要将按钮保留在usercontrol(.ascx)文件中。我为同一个按钮提供了AsyncPostBackTrigger控件ID。但在UpdatePanel中找不到触发器的类似“错误”的内容。有人能帮我吗? 这是我给controlid的 <asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Conditional"> <ContentTemplate> <asp:P

我需要将按钮保留在usercontrol(.ascx)文件中。我为同一个按钮提供了AsyncPostBackTrigger控件ID。但在UpdatePanel中找不到触发器的类似“错误”的内容。有人能帮我吗? 这是我给controlid的

    <asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Conditional">



    <ContentTemplate>

   <asp:Panel ID="pnlYourAccount" runat="server" Style="display: none; height: 100%;
      margin-left: 330px; margin-top: -230px;">

   here is my design

   </asp:Panel>

   </<ContentTemplate>

   </asp:UpdatePanel>

这是我的设计
在aspx页面中

<asp:LinkButton class="anchorstyle" ID="btn1" runat="server" Text="MenuName" OnClick="btn1_Click" />

然后它工作正常。

请显示一些代码。请指定一些代码。请在此处发布您的代码。我已经给出了一些代码部分添加单击事件aspx ane cs页面,然后使用。是的,我已从aspx页面删除触发器。现在添加通过aspx.cs页面。我如何访问aspx页面中用户控件的控件(Linkbutton)。那么您是否面临任何问题?为什么获得此控件。在linkbutton点击事件中,您还需要什么吗?是的。我想设置AsyncPostBackTrigger触发器;trigger.ControlID=“我想在这里设置链接按钮的id”;
<asp:LinkButton class="anchorstyle" ID="btn1" runat="server" Text="MenuName" />
<asp:LinkButton class="anchorstyle" ID="btn1" runat="server" Text="MenuName" OnClick="btn1_Click" />
protected void btn1_Click(object sender, EventArgs e)
{
   //write your code here
}