I have button
inside user control
. 有button
。 I want when the click event of the button
inside user control
fire to find asp:ListView
with ID . 火灾找到asp:ListView
与ID How can I do this ?
<%--add post user control--%>
<uc1:AddPostUserControl runat="server" id="AddPostUserControl" />
<%--show posts--%>
<asp:ListView ID="ShowPostsListView" runat="server">
<ItemTemplate>
<div class="thisPost">
<div class="thisPostAuthor">
<%# this.GetCurrentUser(Eval("User")) %>
</div>
<div class="thisPostHeader">
<h3>
<%# Eval("Title") %>
</h3>
<span class="postDateTime">
<%# Eval("PostDate") %>
</span>
</div>
<div class="thisPostContent">
<p>
<%# Eval("PostContent") %>
</p>
</div>
</div>
</ItemTemplate>
</asp:ListView>
Page page = HttpContext.Current.Handler as Page
ListView lsv = page.FindControl("ShowPostsListView");
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.