写微编程(C#/ ASP.NET) [英] Writing microdata programatically (c# / ASP.NET)

查看:105
本文介绍了写微编程(C#/ ASP.NET)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有可能写价值少属性的WebControl 类型?

Is it possible to write 'value-less' attributes to WebControl types?

即。从

1 = DIV VAR =新的WebControl(HtmlTextWriterTag.Div);

2 = ???

3 =渲染输出:< D​​IV&的itemscope GT;< / DIV>

推荐答案

您可以创建的控制(例如SomeMicroDataWebControl)自WebControl和overrride方法派生出来的渲染。在渲染来定义你的控制将如何看起来像页面上。那么这个类添加到网页或其他控制。

You can created control (E.g. SomeMicroDataWebControl) derived from WebControl and overrride method "Render". In "Render" you define how your control will look like on page. Then add this class to a page or another control.

这篇关于写微编程(C#/ ASP.NET)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆