Click here to Skip to main content
16,004,977 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear Sir

I want to change the text property of label dynamically based on the textbox input,
on text change event,

label1.text=textbox1.text;

is not working
Posted
Comments
OriginalGriff 8-May-11 2:38am    
What is happening?
Have you tried the debugger?

It is working; your problem can be some bug.

I would recommend implementing such features only on client side in Javascript though, because this even it too frequent. For a code sample, please see my recent answer:
Text Area html Control[^].

This code is very similar to what you need but makes sense (frankly, your requirement does not make practical sense: you want to copy all text from a text box to a label of every input; why if the user can see the text being typed anyway?).

—SA
 
Share this answer
 
v2
It's pretty straight forward. Not sure what you mean by 'not working'.

Based on the event that you are trying, all you need is to have:
1. AutoPostback = "true" for the textbox control.
2. Now, in the textbox change event, just put the code: label1.text=textbox1.text;
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900