zoukankan      html  css  js  c++  java
  • UserControls使用总结

    1.    源文件型

    WebUserControl.ascx

    public AddressInfo Address

        {

            set

            {

                if (value != null)

                {

                    if (!string.IsNullOrEmpty(value.Id))

                        id.Text = value.Id;

                    if (!string.IsNullOrEmpty(value.Name))

                        name.Text = value.Name;

                }

            }

    }

     

    <table border="0" cellpadding="0" cellspacing="0">

        <tr>

            <td>

                <asp:Literal ID="id" runat="server"></asp:Literal>

                <asp:Literal ID="name" runat="server"></asp:Literal><br/>

            </td>

        </tr>

    </table>

     

    Default.aspx

    .html

    <%@ Register src="UserControls/WebUserControl.ascx" tagname="ddd" tagprefix="uc1" %>

    <uc1:ddd id="fff" runat="server"></uc1:ddd>

    AddressInfo x = new AddressInfo("asdfa", "asdfa");

    this.fff.Address = x;

    2.    程序集形式:

      <%@ Register assembly="myControls" namespace="myControls" tagprefix="cc1" %>

    <cc1:RainbowLabel ID="RainbowLabel1" runat="server"></cc1:RainbowLabel>

    this. RainbowLabel1.Address = x;

    文章出处:www.cnblogs.com/jizhong

    本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接。否则保留追究法律责任的权利。

  • 相关阅读:
    JS小功能系列9商品筛选
    JS小功能系列8省市联动
    if u
    js属性
    js初识
    弹性盒
    项目合作
    css重置
    关于响应式布局
    自我定位
  • 原文地址:https://www.cnblogs.com/jizhong/p/1295631.html
Copyright © 2011-2022 走看看