我無法找到位於FormView控制器內部的名爲「repScore」的中繼器控制器。無法在FormView中查找中繼器
這是我的代碼:
<asp:FormView runat="server" id="fwHotelDetails" DataKeyNames="id" OnDataBound="fwHotelDetails_DataBound" >
<ItemTemplate>
// (..) some code here which outputs some data
<asp:Repeater runat="server" id="repScore">
<ItemTemplate>
<span class="item"> <%# Eval("criteria") %>:</span>
</ItemTemplate>
</asp:Repeater>
</ItemTemplate>
</asp:FormView>
這是我的代碼背後:
protected void fwHotelDetails_DataBound(object sender, EventArgs e)
{
Repeater rep = (Repeater)fwHotelDetails.FindControl("repScore");
rep.DataSource = this.dtCriteria;
rep.DataBind();
}
我在做什麼錯?
如果上面的代碼已被編輯以反映工作代碼,您應該在您的帖子中說。 – GFoley83 2013-06-30 22:27:50