?
Solved

Adding OnTextChange to Programatically added Textboxes?

Posted on 2008-10-20
2
Medium Priority
?
395 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 13

Accepted Solution

by:
crazyman earned 2000 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Suggested Courses

777 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