我想獲得一個asp:文字工作,但顯然我做錯了什麼,因爲我正在一個ASP文字工作不
對象Referece未設置爲對象的實例
錯誤
這是我的代碼:
在ASCX頁:
<span class="span1">
<asp:Literal ID="litFile" runat="server"></asp:Literal>
<strong><asp:Literal ID="litFile2" runat="server"></asp:Literal></strong>
</span>
和
在ascx.cs頁:
protected void _ItemBound(object sender, RepeaterItemEventArgs e)
{
((Literal)e.Item.FindControl("litFile")).Text = "a";
}
任何想法嗎?
C
你能告訴我們更多的代碼嗎?這是在網格中的文字?你想要做什麼事件處理程序? – kevev22 2011-02-02 15:52:27