• /* 自定义控件*/


    创建自定义控件
    BLL层中的Hello.cs:
    using System;
    using System.Web.UI;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Text;
    using System.Windows.Forms;

    namespace BLL
    {
        
    public partial class Hello : System.Web.UI.Control
        
    {

            
    /*在BLL层右键Add---〉CustomControl会自动产生下面的一个构造器
             * 和一个OnPaint方法---〉怀疑和using System.Windows.Forms;有关
             
    */

            
    //public Hello()
            
    //{
            
    //    InitializeComponent();
            
    //}

            
    //protected override void OnPaint(PaintEventArgs pe)
            
    //{
            
    //    // TODO: Add custom paint code here

            
    //    // Calling the base class OnPaint
            
    //    base.OnPaint(pe);
            
    //}
            protected override void Render(HtmlTextWriter writer)
            
    {
                
    //base.Render(writer);
                writer.Write("Hello,baby!");
            }

        }

    }


    UI层的Hello.aspx
    Hello.aspx
  • 相关阅读:
    IfcControlExtension (控件扩展)
    IfcKernel (内核)
    IFC4x0核心层
    IfcSharedMgmtElements (共享管理元素)
    IfcSharedFacilitiesElements (共享设施元素)
    IfcSharedComponentElements (共享组件元素)
    IfcSharedBldgServiceElements (共享建筑服务要素)
    IfcSharedBldgElements (共享建筑元素)
    IFC4x0共享层
    IfcStructuralElementsDomain (结构元素领域)
  • 原文地址:https://www.cnblogs.com/simhare/p/827180.html
Copyright © 2020-2023  润新知