Solved

Adding OnTextChange to Programatically added Textboxes?

Posted on 2008-10-20
2
389 Views
Last Modified: 2012-05-05
How can I add an OnTextChange event to a textbox I am adding programatically?
0
Comment
Question by:higginsonline
2 Comments
 
LVL 13

Accepted Solution

by:
crazyman earned 500 total points
ID: 22758345
AddHandler txtError.TextChanged, AddressOf txtError_TextChanged

...

Protected Sub txtError_TextChanged(ByVal sender As Object, ByVal e As EventArgs)
End Sub
0
 
LVL 6

Expert Comment

by:AmarIs26
ID: 22759048
You need to recreate each textbox everytime the page is created (even during postbacks). In addition to this you need to assign an id to each textbox, this id must remain constant. so if you are creating textboxes inside the a loop then something like the following will do
textbox(i).ID = "textBox" + i.ToString()
The reason for setting an id is that, after the control is created during postbacks, it will map onto the correct event handler for that instance based on the ID.
Finally, Do what CrazyMan suggested.
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now