Click here to Skip to main content
15,885,091 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
Iam having a "TextBox" a "Label" and a "Button" in my aspx page. If i enter some values into the textbox,then tat values should b displayed in the label...and agaig i enter some values in the same text box,tat values should b displayed without disturbing the first value and so on....very urgent Help me please..............
Posted
Comments
Henry Minute 3-Feb-11 16:46pm    
Telling us your problem is urgent will, more often than not result in your getting no answers. In this case It got you an incorrect answer and a couple of down-votes.

Try lbl.Caption += textbox.Text;
 
Share this answer
 
Comments
fjdiewornncalwe 3-Feb-11 14:20pm    
Slight modification. Should be lbl.Text += textbox.Text.
Abhinav S 3-Feb-11 23:29pm    
Good point. Thanks. I was thinking winforms all the time.
Sergey Alexandrovich Kryukov 3-Feb-11 22:12pm    
OP asked for it! I can imagine layout mess after using this method, especially taking into account OP's apparent skill level.
Not your fault, you still got 5.
--SA
Abhinav S 3-Feb-11 23:28pm    
Thanks SA. I dont know what else the IO wanted.
Espen Harlinn 6-Feb-11 11:42am    
Nice and simple, my 5
What Abhinav suggested is a server side way that would need a postback to take affect.

I would suggest you to go ahead with Javascript. Use textbox onchange or onblurr event. Attach them to a JS method. In the JS method, get the value of textbox and assign that to the desired label.

Try!
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 4-Feb-11 3:49am    
Hm. Another flip of a coin. A 5.
--SA
Sandeep Mewara 4-Feb-11 3:56am    
Yup! :)
Espen Harlinn 6-Feb-11 11:41am    
Good answer, a bit more complicated then Abhinav - but better, a 5
Sandeep Mewara 6-Feb-11 11:46am    
:) Yep, complicated one but would surely be the one preffered by users.
Espen Harlinn 6-Feb-11 12:01pm    
With the aid of jQuery - it shouldn't be all that hard - as I said a better solution!

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