zoukankan      html  css  js  c++  java
  • /* 自定义控件*/

    创建自定义控件
    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
  • 相关阅读:
    tomcat shutdown后,进程还存在linux系统中的解决办法
    nginx反向代理tcp协议的80端口
    redis集群搭建中遇到的一些问题
    《将博客搬至CSDN》
    最短路路径(1.1版待更新)
    线段树
    SDUT 3341 数据结构实验之二叉树二:遍历二叉树
    二叉树的遍历
    爆头题HDU
    图的入度和出度以及图的新的存储形式
  • 原文地址:https://www.cnblogs.com/simhare/p/827180.html
Copyright © 2011-2022 走看看