我正在尝试做
<asp:UpdatePanel ID="UpdatePanel2" runat="server">
<Triggers>
<asp:AsyncPostBackTrigger ControlID="Button1" EventName="Click" />
</Triggers>
<ContentTemplate>
<asp:DataList ID="DataList2" runat="server" CellPadding="4" ForeColor="#333333" OnItemCommand="DataList2_ItemCommand">
<FooterStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
<AlternatingItemStyle BackColor="White" />
<ItemStyle BackColor="#E3EAEB" />
<SelectedItemStyle BackColor="#C5BBAF" Font-Bold="True" ForeColor="#333333" />
<HeaderStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
<ItemTemplate>
<asp:Label ID="Label6" runat="server" Text='<%# Eval("Discription") %>'></asp:Label>
<asp:Label ID="Label7" runat="server" Text='<%# Eval("SubmittedTime") %>'></asp:Label>
<br />
<br />
<asp:Label ID="Label9" runat="server" ForeColor="#CC0000" Text="Comments"></asp:Label>
<br />
<br />
<asp:LinkButton ID="LinkButton5" runat="server" OnClick="LinkButton5_Click">Add Comment</asp:LinkButton>
<br />
<asp:Panel ID="Panel2" runat="server" Visible="False" Style="padding-left: 100px;">
<asp:TextBox ID="TextBox2" runat="server" Height="40px" TextMode="MultiLine" Width="497px"></asp:TextBox>
<asp:Button ID="Button3" runat="server" OnClick="Button3_Click" Text="Add" CommandName="Add"
OnCommand="Button3_Command" />
</asp:Panel>
<br />
</ItemTemplate>
</asp:DataList>
</ContentTemplate>
</asp:UpdatePanel>
button3_Click 的编码是
protected void Button3_Click(object sender, EventArgs e)
{Button pn = (Button);
DataListItem dl = (DataListItem)pn.NamingContainer;
Panel p1 = (Panel)dl.NamingContainer;
TextBox pan = (TextBox)dl.FindControl("TextBox2");}
但是 button3_Click 事件不起作用。我已经在那里应用了断点,但光标没有出现在断点上。