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
  • 相关阅读:
    <html>
    poj 2676 Sudoku
    百亿互金平台救火故事
    Retrofit三步理解之中的一个 ------------------ Retrofit的简单使用总结
    精简版—愤慨的小鸟
    POJ 1095 Trees Made to Order
    Android Studio 错误: 非法字符: &#39;ufeff&#39; 解决方式|错误: 须要class, interface或enum
    使用CodePush实时更新 React Native 和 Cordova 应用
    获取url地址参数
    利用jQuery 通用文件导出前端实现,MVC文件导出
  • 原文地址:https://www.cnblogs.com/simhare/p/827180.html
Copyright © 2011-2022 走看看