【发布时间】:2010-10-11 10:15:21
【问题描述】:
我有一个像这样的ListView
<asp:ListView ID="ListView1" runat="server">
<EmptyDataTemplate>
<asp:Literal ID="Literal1" runat="server" text="some text"/>
</EmptyDataTemplate>
...
</asp:ListView>
在Page_Load() 我有以下内容:
Literal x = (Literal)ListView1.FindControl("Literal1");
x.Text = "other text";
但x 返回null。我想更改Literal 控件的文本,但我不知道该怎么做。
【问题讨论】:
标签: c# asp.net .net listview findcontrol