Hi Mariame,
Are you adding your own handler? Here's some code to show how it is done.
Note that getting the TextChanged event to fire can be tricky... you may
need to hit the Enter key in the texbox after changing the text.
Private Sub Page_Load _
(ByVal sender As System.Object, _
ByVal e As System.EventArg s) Handles MyBase.Load
Dim txtbx As New TextBox
txtbx.ID = "Mytextbox"
txtbx.Text = "Change this text and hit Enter"
txtbx.EnableVie wState = True
PlaceHolder1.Co ntrols.Add(txtb x)
AddHandler txtbx.TextChang ed, AddressOf TextBox_TextCha nged
End Sub
Private Sub TextBox_TextCha nged _
(ByVal sender As System.Object, ByVal e As System.EventArg s)
Dim txtbx As TextBox
txtbx = sender
Label1.Text = txtbx.ID & " at " & Now.ToLongTimeS tring
End Sub
<form id="Form1" method="post" runat="server">
<p>
<asp:placeholde r id="PlaceHolder 1"
runat="server"> </asp:placeholder >
<asp:label id="Label1" runat="server"> </asp:label></p>
<p> </p>
</form>
Does this help?
Ken
Microsoft MVP [ASP.NET]
Toronto
"Mariame" <ma************ @hotmail.com> wrote in message
news:eZ******** ******@TK2MSFTN GP14.phx.gbl...
Hi everyone
i have a textbox that is added dynamically in form load
i want an event to happen when the text change
how can i do it?
Thx in Adv