【发布时间】:2010-09-09 19:42:28
【问题描述】:
我正在尝试运行 MSDN 提供的模板化用户控件示例。代码如下:
所以根据 MSDN,这应该实现如下:
<%@ Register Assembly="MyAssembly" Namespace="MyAssembly.Controls" TagPrefix="abs" %>
<abs:TemplatedFirstControl id = "First" runat=server
Text= "The time on the server is " >
<FirstTemplate>
<h3><font face="Verdana" color = "red">
<%# Container.Text %> <%# Container.DateTime %>
</font>
</h3>
</FirstTemplate>
</abs:TemplatedFirstControl>
设计师抱怨TemplatedFirstControl的开始和结束标签之间不允许有内容,并且不支持FirstTemplate。那么缺少什么?我逐字复制了 MSDN 的代码
MSDN 文章:http://msdn.microsoft.com/en-us/library/aa720695%28v=VS.71%29.aspx
【问题讨论】:
-
你对前缀
abs的定义是什么? -
在 .aspx 中的
-
考虑编辑问题以包含该注册标记,以及指向 MSDN 文章的链接。是否还需要创建任何 web.config 条目?
-
没有。这应该很简单。