Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个Repeater,它在每个ItemTemplate 中包含一个表行。在我的数据中,我有一个名为 EditKey 的 Guid。我想将此 EditKey 放入 id 字段中。
我试图像这样添加它:
" clientidmode="静态">
但我得到一个解析器错误:
控件的 ID 属性只能使用标记中的 ID 属性和简单值来设置。例子:
我无法在代码隐藏中操作 id。解决这个问题的最佳方法是什么?
劳埃德
我想通了。我试图将 tr 作为服务器控件。我删除了 runat="server" 并将我的 Guid 作为纯 html 绑定到 id 属性中。随着云层散开,阳光开始照耀,解析器不再有任何抱怨。