<asp:TextBox ID="TextBox1" Text="textbox控件" runat="server">asp:TextBox>
<asp:TextBox ID="TextBox1" Text="textbox控件" runat="server" Font-Bold="True">asp:TextBox>
<asp:DataList ID="DataList1" runat="server">
<SelectedItemStyle />
<EditItemStyle />
asp:DataList>
<asp:DropDownList ID="DropDownList1" runat="server">
<asp:ListItem>xasp:ListItem>
<asp:ListItem>xxasp:ListItem>
<asp:ListItem>xxxasp:ListItem>
asp:DropDownList>
using System;
namespace CustomComponents

{
/**////
/// 职业
///
public enum Metier
{
教师,程序员,作家
}
}
using System;
using System.ComponentModel;
namespace CustomComponents

{


/**////
/// 地址集合
///
public class Address
{
private String street = null;
private String city = null;
private String state = null;
private String zip = null;
public String Street
{
get
{
return street;
}
set
{
street = value;
}
}

public String City
{
get
{
return city;
}
set
{
city = value;
}
}
public String State
{
get
{
return state;
}
set
{
state = value;
}
}
public String Zip
{
get
{
return zip;
}
set
{
zip = value;
}
}
}
}
using System;
using System.ComponentModel;
using System.Web;
using System.Web.UI;
namespace CustomComponents

{
public class Custom: Control
{
private String name = null;
Address address = new Address();
private Metier metier;
private int age = 0;

属性#region 属性
[Description("年龄")]
public int Age
{
get
{
return age;
}
set
{
age = value;
}
}
[Description("姓名")]
public String Name
{
get
{
return name;
}
set
{
name = value;
}
}
[Description("职业")]
public Metier CustomMetier
{
get
{
return metier;
}
set
{
metier = value;
}<
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/12639172/viewspace-402613/ ,如需转载,请注明出处,否则将追究法律责任。