我的技术之路

知之求生

用户控件的制作

用户控件部分代码:
public partial class input : System.Web.UI.UserControl
{

    public string Username
    {
        get
        {
            return this.TextBox1.Text;
        }
        set
        {
            Username = value;
        }
    }
    public string Userpwd
    {
        get
        {
            return this.TextBox2.Text;
        }
        set
        {
            Userpwd = value;
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void Button2_Click(object sender, EventArgs e)
    {
        this.TextBox1.Text = "";
        this.TextBox2.Text = "";
    }
    protected void Button1_Click(object sender, EventArgs e)
    {

    }
}

引用部分代码
    protected void Page_Load(object sender, EventArgs e)
    {
        this.Label2.Text = this.Input1.Username + "  " + this.Input1.Userpwd;
    }

posted on 2008-04-28 00:26  Tronat  阅读(149)  评论(0编辑  收藏  举报

导航