.aspx Code
<asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="Button" />
.cs Code:
using System;
using System.Windows.Forms;
namespace Musakkhir
{
public partial class WebForm8 : System.Web.UI.Page
{
System.Web.UI.WebControls.TextBox t = new System.Web.UI.WebControls.TextBox();
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
t.AutoPostBack = true;
t.TextChanged+=new EventHandler(t_TextChanged);
}
protected void t_TextChanged(object sender, EventArgs e)
{
this.Controls.Add(t);
t.Attributes.Add("runat", "sever");
MessageBox.Show("New text change event");
}
}
}
<asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="Button" />
.cs Code:
using System;
using System.Windows.Forms;
namespace Musakkhir
{
public partial class WebForm8 : System.Web.UI.Page
{
System.Web.UI.WebControls.TextBox t = new System.Web.UI.WebControls.TextBox();
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
t.AutoPostBack = true;
t.TextChanged+=new EventHandler(t_TextChanged);
}
protected void t_TextChanged(object sender, EventArgs e)
{
this.Controls.Add(t);
t.Attributes.Add("runat", "sever");
MessageBox.Show("New text change event");
}
}
}
No comments :
Post a Comment