用户控件的制作
用户控件部分代码:
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;
}