2012-08-30 22 views
-1

我发现头控制在直放站在C#如何在Repeater中查找标题控件?

HtmlGenericControl nameposition = null; 
          nameposition = (HtmlGenericControl)Repeater1.Controls[0].Controls[0].FindControl("tweet-container"); 

我得到错误如何使用它的.aspx代码

<div id="tweet-container" runat="server"> </div> 
+1

哪里中继标记? “标题”标记在哪里?在你的代码背后,你是否试图访问中继器? – Oded

+0

你得到的错误是什么? – Buzz

回答

0

所以,如果一台服务器的控制,你可以简单地使用:
在Repeater_ItemDataBound事件

HtmlGenericControl divControl = e.Item.FindControl("tweet-container") as HtmlGenericControl;