强制控件仅包含某些元素,例如 ContentTemplate
好的,我的团队一直遇到 ajaxToolkit Tabs 控件的问题,它与我们网站的某些部分配合得不好(主要是 jquery 问题,其他一些 javascript,需要更改的东西太多)
所以,我计划编写一个不同的控件使用 jQuery 实现选项卡功能:我以前做过这个,jQuery 几乎是微不足道的。我遇到的问题是让控件本身模拟 AjaxToolkit 控件,我希望它是一个具有内容/标题模板结构的适当的 Web 控件。
但是,我似乎无法强制 asp 只允许在内部使用这些标签,就像中继器对其各种 <*template> 所做的那样。标签,仅让它将这些标签显示为标记内的选项。我将如何实现这个功能?
Ok, my team has been having issues with the ajaxToolkit Tabs control, it doesn't play nice with parts of our site (mainly jquery issues, some other javascript, too many things to change)
So, I plan to write a different control that uses jQuery to achieve the tabbing functionality: I've done this before, and the jQuery is almost trivial. The thing I am having issues with is getting the Control itself to emulate the AjaxToolkit control, I'd like it to be a proper webcontrol with a content/header template structure.
However, I cannot seem to force asp to only allow these tags inside, as a repeater does with it's various <*template> tags, only get it to display these tags as options inside the markup. How would I achieve this functionality?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
ContentTemplate 就像中继器使用带有一些属性的 ITemplate 属性,以下是相关信息:
它是 ParseChildrenAttribute,PersistenceModeAttribute,并使用 PersistChildrenAttribute 将它们显示为内部标签。
The ContentTemplate like say a Repeater uses an ITemplate property with a few attribues, here's the pertinent info:
It's a combination of ParseChildrenAttribute, PersistenceModeAttribute, and using the PersistChildrenAttribute to display them as inner tags.