how to fire a event to my dynamic created textboxes?...say all buttons
will inturn call a same method...say sayhi()?
here is my code...
Thanks in advance.


<% Page language="c#" Codebehind="WebForm1.aspx.cs"
AutoEventWireup="false" Inherits="dyna.WebForm1" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1">
<meta name="CODE_LANGUAGE" Content="C#">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema"
<body MS_POSITIONING="GridLayout">
<form id="Form1" method="post" runat="server">
<asp:Label id="Label1" style="Z-INDEX: 101; LEFT: 39px; POSITION:
absolute; TOP: 61px" runat="server">enter no of textbox to
<asp:TextBox id="TextBox1" style="Z-INDEX: 102; LEFT: 46px;
POSITION: absolute; TOP: 91px" runat="server"></asp:TextBox>
<asp:PlaceHolder id="PlaceHolder1"
<asp:Button id="Button1" style="Z-INDEX: 104; LEFT: 225px;
POSITION: absolute; TOP: 94px" runat="server"

Behind the code
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;

namespace dyna
/// <summary>
/// Summary description for WebForm1.
/// </summary>
public class WebForm1 : System.Web.UI.Page
protected System.Web.UI.WebControls.Label Label1;
protected System.Web.UI.WebControls.TextBox TextBox1;
protected System.Web.UI.WebControls.PlaceHolder PlaceHolder1;
protected System.Web.UI.WebControls.RangeValidator RangeValidator1;
protected System.Web.UI.WebControls.Button Button1;

private void Page_Load(object sender, System.EventArgs e)
// Put user code to initialize the page here


#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
// CODEGEN: This call is required by the ASP.NET Web Form Designer.


/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
this.Button1.Click += new System.EventHandler(this.Button1_Click);
this.Load += new System.EventHandler(this.Page_Load);


private void Button1_Click(object sender, System.EventArgs e)
int i;
int count=Int32.P(TextBox1.Text);
Button str = new Button();
str.ID = "box"+i.ToString() ;