Click here to Skip to main content
11,484,752 members (62,025 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#4.0 .NET4 ASP:NET
i have create web app
in which taken three textboxes
when i entered value in textbox1..i want that value should display on textbox2 and textbox3


code is behind

public class Class1
{
 

          public double cal(double amount)
        {
            return((amount+(amount*0.01)));
        }
 

 

 

 

 

}
 
 protected void TextBox1_TextChanged(object sender, EventArgs e)
    {
 
        Class1 c = new Class1();
        TextBox2.Text = c.cal(Convert.ToDouble(TextBox1.Text)).ToString();
 TextBox3.Text = c.cal(Convert.ToDouble(TextBox1.Text)).ToString();
    }
 

 

 protected void Button1_Click(object sender, EventArgs e)
    {
        Class1 c = new Class1();
        TextBox2.Text = c.cal(Convert.ToDouble(TextBox1.Text)).ToString();
    }
 

 

on button_click its working but not on textbox_textchanged

so telll me on this regard
Posted 2-Jan-13 1:44am

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Hi,

You need to set your textbox's AutoPostback = true[^].

best luck
  Permalink  
Comments
Member 7882565 at 2-Jan-13 7:11am
   
thanks
@AmitGajjar at 2-Jan-13 7:12am
   
your welcome.

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

  Print Answers RSS
0 Maciej Los 190
1 Sergey Alexandrovich Kryukov 180
2 Raje_ 155
3 OriginalGriff 147
4 Mehdi Gholam 120
0 Sergey Alexandrovich Kryukov 8,494
1 OriginalGriff 7,948
2 Sascha Lefèvre 3,199
3 Maciej Los 2,681
4 Richard Deeming 2,370


Advertise | Privacy | Mobile
Web01 | 2.8.150520.1 | Last Updated 2 Jan 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100