惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

月光博客
月光博客
C
Check Point Blog
J
Java Code Geeks
腾讯CDC
Apple Machine Learning Research
Apple Machine Learning Research
宝玉的分享
宝玉的分享
Microsoft Azure Blog
Microsoft Azure Blog
WordPress大学
WordPress大学
量子位
Google DeepMind News
Google DeepMind News
I
InfoQ
The GitHub Blog
The GitHub Blog
aimingoo的专栏
aimingoo的专栏
N
Netflix TechBlog - Medium
Hugging Face - Blog
Hugging Face - Blog
博客园 - Franky
V
V2EX
Blog — PlanetScale
Blog — PlanetScale
T
The Blog of Author Tim Ferriss
小众软件
小众软件
博客园_首页
人人都是产品经理
人人都是产品经理
博客园 - 聂微东
IT之家
IT之家

博客园 - Guxx

一路有你站点开通,特别祝贺 mstIsUsedBy Domino和IIS共存一台服务器的配置 Subversion安装 ASP.NET的调试方法 showModalDialog打开网页和disabled后表单提交的问题。 项目刷新失败,无法从服务器中检索文件夹信息 css在不同的文档类型中的区别 - Guxx - 博客园 A标签伪类的使用方法 不规范的命名对ASP.NET中基于窗体的自定义身份验证的影响 Flash动态载入JPEG图片 在线配色 我曾经做过的网站 DotNetNuke的皮肤研究笔记 解决DotNetNuke3.0.8菜单不能使用中文的方法 IIS应用程序池的设置对dotnetnuke3.0.8运行的影响 让IE窗口填满屏幕,但不是FullScreen. Sps界面定制手记 如何批量加密存储过程?
Asp.Net服务器控件开发心得
Guxx · 2004-11-04 · via 博客园 - Guxx

1、经过一些挫折后,终于明白了RenderBeginTag和RenderEndTag的用法。
     RenderBeginTag和RenderEndTag方法实现了呈现HTML标签的功能,方便灵活。但是它和WriteBeginTag的用法不同。比如:
     要呈现<span id="ComboBox19_main" class="WebComboBoxFrame" style="width:184px;"></span>
     两者的写法如下:
            writer.AddAttribute(HtmlTextWriterAttribute.Id, this.ClientID + "_main");
            writer.AddAttribute(HtmlTextWriterAttribute.Class, "WebComboBoxFrame");
            writer.AddStyleAttribute(HtmlTextWriterStyle.Width, this.Width.ToString());

            writer.RenderBeginTag(HtmlTextWriterTag.Span);
            writer.RenderEndTag();

            writer.WriteBeginTag("SPAN");
            writer.WriteAttribute("ID", this.ClientID + "_main");
            writer.WriteAttribute("CLASS", "WebComboBoxFrame");
            writer.WriteAttribute("STYLE", this.Attributes["style"] + ";width:" + this.Width.ToString());
            writer.Write(">");
            writer.WriteEndTag("SPAN");
      注意红色部分是呈现属性和样式的,两者的位置是不同的。