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

推荐订阅源

让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
T
The Blog of Author Tim Ferriss
博客园 - 司徒正美
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
有赞技术团队
有赞技术团队
量子位
S
SegmentFault 最新的问题
博客园 - 聂微东
博客园 - 【当耐特】
J
Java Code Geeks
美团技术团队
Hugging Face - Blog
Hugging Face - Blog
H
Help Net Security
V
V2EX
人人都是产品经理
人人都是产品经理
博客园 - Franky
罗磊的独立博客
Engineering at Meta
Engineering at Meta
A
About on SuperTechFans
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
酷 壳 – CoolShell
酷 壳 – CoolShell
云风的 BLOG
云风的 BLOG
Y
Y Combinator Blog
Apple Machine Learning Research
Apple Machine Learning Research

博客园 - 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");
      注意红色部分是呈现属性和样式的,两者的位置是不同的。