Click here to Skip to main content
15,890,506 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
hi iam sriram iam a fresher
my task:i have taken 1labelcontrol,1textbox,1button in asp webapplication now my problem i want code such that if i enter my name in textbox the name should display in label after execution please help me kindly

[edit]Subject: always use a subject that reflects the problem, not your experience level, it helps us to know if we can assist on that subject - OriginalGriff[/edit]
Posted
Updated 17-Jun-11 1:12am
v2
Comments
Sandeep Mewara 17-Jun-11 7:33am    
Any effort?

This sounds like your homework, so no code!

Handle the button click event: double click on the button in the designer and it will take you to the code fro the handler.
Then you need to copy the Text Property from the TextBox (which will imaginatively be called "textBox1" I suspect) into the Text Property of the Label (which I imagine will be called "label1").

Property access: controlname.propertyname
Assignment: destination = source
 
Share this answer
 
Just try to write the code in TextChanged event of textbox

Label1.Text=TextBox1.Text;

set TextBox property :

Autopostback=TRUE;


here TextBox1,Label1 are ids of controls.
 
Share this answer
 
v2
Comments
sriram from Hyderabad 17-Jun-11 8:54am    
thank u very much sir u made me confident thank u very much
try this:

private void button1_Click(object sender, EventArgs e)
{
  string name=textbox1.Text;
  label1.text=name;
}


hope this helps :)
 
Share this answer
 
v2

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