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

推荐订阅源

博客园 - 三生石上(FineUI控件)
Blog — PlanetScale
Blog — PlanetScale
B
Blog
GbyAI
GbyAI
爱范儿
爱范儿
月光博客
月光博客
N
Netflix TechBlog - Medium
T
Tailwind CSS Blog
G
Google Developers Blog
大猫的无限游戏
大猫的无限游戏
Vercel News
Vercel News
H
Hackread – Cybersecurity News, Data Breaches, AI and More
WordPress大学
WordPress大学
The GitHub Blog
The GitHub Blog
Recent Announcements
Recent Announcements
腾讯CDC
MyScale Blog
MyScale Blog
V
Visual Studio Blog
The Cloudflare Blog
Microsoft Security Blog
Microsoft Security Blog
A
About on SuperTechFans
Google DeepMind News
Google DeepMind News
Last Week in AI
Last Week in AI
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻

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