Click here to Skip to main content
15,881,172 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
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

C#
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

1 solution

Hi,

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

best luck
 
Share this answer
 
Comments
shivani 2013 2-Jan-13 7:11am    
thanks
AmitGajjar 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)



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