您的位置:首页 > 其它

Repeater或者DataList中如果要使用Custom User Control可以使用如下方法

2006-12-12 23:11 405 查看
Repeater或者DataList中如果要使用Custom User Control可以使用如下方法。


<asp:Repeater ID="repeater1" runat="server">


<ItemTemplate>


<tr>


<td><uc1:mycontrol runat="server" id="mycontrol1" ProductID='<%# DataBinder.Eval(Container.DataItem, "Key") %>' /></td>


</tr>


</ItemTemplate>


</asp:Repeater>

注意,如果 '<%# ... %>' 没有用单引号而用双引号,服务器会发出The server tag is not well formed的错误。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐