博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

随笔分类 -  asp.net控件与组件

asp.net控件与组件
摘要:明天考试.先留着.之后补上. 阅读全文

posted @ 2007-12-21 20:19 a-peng 阅读(320) 评论(4) 推荐(0)

摘要:新建一个网页.拉入一个Button控件. 选中该控件查看属性编辑器: 从图中可以看出有多种属性方式. 简单属性: BorderWidth,CssClass等等. 复杂属性 (可折叠) Font其下有好多个属性 Bold,Name等等. 我们对其设置一下,查看它的属性有何特别之处 简单 runat="server" -... 阅读全文

posted @ 2007-12-20 21:03 a-peng 阅读(697) 评论(0) 推荐(0)

摘要:HTML服务器控件的控件从System.Web.UI.HtmlControls.HtmlControl 类派生 标准服务器控件的控件从System.Web.UI.WebControls.WebControl 类派生 HtmlControl 类和WebControl 类则从System.Web.UI.Control 类派生,并扩展. 前面我们都是使用Control来派生.我们有很多事需要自己做.... 阅读全文

posted @ 2007-12-19 22:18 a-peng 阅读(925) 评论(0) 推荐(0)

摘要:先来做个实验: 新建一网页.拉入一个TextBox控件.双击它.则系统默认为其添加TextChanged事件的处理函数 protected void TextBox1_TextChanged(object sender, EventArgs e) { Response.Write(""); } 接着又拉入一个Button控件 运行程序,在textbox中输入任意字符串,点击,button触使页面... 阅读全文

posted @ 2007-12-19 20:01 a-peng 阅读(1116) 评论(0) 推荐(0)

摘要:在asp.net组件(5)中有一个事件,我们会其创建一个委托. 那现在的需求是,一个控件中有好多个事件.比如DataList中就有好多个事件, 现在我们夸大一下我们的需求.如果这个控件有1000个事件来说明性能的重要性. using System; using System.Web.UI; namespace WebComponent { [ToolboxData(@"")] ... 阅读全文

posted @ 2007-12-19 17:15 a-peng 阅读(383) 评论(0) 推荐(0)

摘要:事件处理以前是属于windows应用程序开发的. 现在web开发也具有了. 现在就来看看asp.net它是怎么做到的. asp.net中的程序: 往窗体中拉入一个Button控件 双击一下它,为其添加单击事件响应 //this.Button1.Click += new EventHandler(Button1_Click) //由于用的是vs2005,所以我补上了... 阅读全文

posted @ 2007-12-18 22:54 a-peng 阅读(678) 评论(0) 推荐(0)

摘要:首先往Web窗体中拉入几个控件. 有4个控件组成.label button panel中含textbox 将label的Visable设为false即,使其不被显示. 然后开启跟踪,运行程序 得到以下数据 我们看到很多个LiteralControl控件,这个是用来做什么呢?我们没有添加这个控件呀? 其实这是asp.net程序代码中的空白部份. 比如: 两个控件之间就有了空白了.Lit... 阅读全文

posted @ 2007-12-18 19:23 a-peng 阅读(422) 评论(0) 推荐(0)

摘要:我们主要研究RenderControl,Render,RenderChildren的执行顺序. 三者的含义从他们的命名可以很清楚的看出. RenderControl绘制控件 Render绘制 RenderChildren绘制子控件 看下面的代码 public class UserComponent : Control { public UserComponent() { ... 阅读全文

posted @ 2007-12-18 18:15 a-peng 阅读(1895) 评论(2) 推荐(0)

摘要:在 前一篇 组件(1) 中加入以下代码 Render主要用来 绘制控件. HtmlTextWriter 用来将标志输出到浏览器 protected override void Render(HtmlTextWriter writer) { //base.Render(writer); //第... 阅读全文

posted @ 2007-12-17 22:52 a-peng 阅读(716) 评论(0) 推荐(0)

摘要:新建类库 WebComponent using System; using System.ComponentModel; using System.Web.UI; namespace WebComponent { [DefaultPropertyAttribute("Name")] [ToolboxData(@"")] public class UserComponen... 阅读全文

posted @ 2007-12-17 16:50 a-peng 阅读(1286) 评论(0) 推荐(0)