Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Textbox and onTextChanged Event

Reply
Thread Tools

Textbox and onTextChanged Event

 
 
Paul
Guest
Posts: n/a
 
      06-14-2006
Hello:

I create a textbox control programatically something like this:

Dim td As New TableCell()
Dim txtbox As New TextBox()
txtbox.ID = "my_textbox"
td.Controls.Add(txtbox)

Now I want to programatically associate a "OnTextChanged" event to this
textbox.

How can I do this?

When I view the page source, the ID of the textbox control is something like
"ctl00$my_textbox". So the textbox ID actually gets changed.

Can anyone point me to an example or a link that explains how to do this?

TIA.

- Paul
 
Reply With Quote
 
 
 
 
Balasubramanian Ramanathan
Guest
Posts: n/a
 
      06-14-2006
for serverside event associate the TextChanged event

If you want to refer this textbox in the client side use the ClientId
property of the control.


"Paul" <> wrote in message
news:C1CC08D0-7639-4024-BE52-...
> Hello:
>
> I create a textbox control programatically something like this:
>
> Dim td As New TableCell()
> Dim txtbox As New TextBox()
> txtbox.ID = "my_textbox"
> td.Controls.Add(txtbox)
>
> Now I want to programatically associate a "OnTextChanged" event to this
> textbox.
>
> How can I do this?
>
> When I view the page source, the ID of the textbox control is something
> like
> "ctl00$my_textbox". So the textbox ID actually gets changed.
>
> Can anyone point me to an example or a link that explains how to do this?
>
> TIA.
>
> - Paul



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Textbox OnTextChanged Inside a Datalist hooterbite@yahoo.com ASP .Net 0 01-02-2007 05:28 PM
Textbox with OnTextChanged Event =?Utf-8?B?UGF1bA==?= ASP .Net 2 06-14-2006 03:38 PM
Textbox and OnTextChanged MattB ASP .Net 4 09-28-2005 11:34 PM
Retreiving old value from WebControls.TextBox with OnTextChanged Mark Siffer ASP .Net 3 03-30-2005 04:38 PM
textbox's state does not persist if onTextChanged not defined Henri ASP .Net 6 08-06-2004 02:08 PM



Advertisments