C# asp.net

Discussion in 'Software' started by ahsan2011, Apr 18, 2007.

  1. ahsan2011

    ahsan2011

    Joined:
    Apr 17, 2007
    Messages:
    2
    Likes Received:
    0
    hi i m started learnin asp.net..need help..

    i have created 3 textboxes and a button..

    wanna display the no in first two boxes and display their sum in the third box at the click of a button..

    have tried writing the code at the button event.

    textbox3.text = textbox1.text + textbox2.text

    but it adds the strings together...eg12 +11 =1211

    when i write
    textbox3.text = convert.toint32(textbox1.text) + convert.toint32(textbox2.text)
    but it shows "implicitly cannot convert string to int...

    please help
     
    ahsan2011, Apr 18, 2007
    #1
    1. Advertisements

  2. ahsan2011

    Mr_helper

    Joined:
    May 12, 2007
    Messages:
    1
    Likes Received:
    0
    use this code

    int sum = Convert.ToInt32(textBox1.Text) + Convert.ToInt32(textBox2.Text);
    textBox3.Text = sum.ToString();

    Or

    textBox3.Text = Convert.ToString(Convert.ToInt32(textBox1.Text) + Convert.ToInt32(textBox2.Text));
     
    Last edited: May 12, 2007
    Mr_helper, May 12, 2007
    #2
    1. Advertisements

  3. ahsan2011

    abdul

    Joined:
    Jun 6, 2007
    Messages:
    1
    Likes Received:
    0
    how to include user-defined class in asp.net2005

    i want to know how to include a class in asp.net 2005 framwork 2.0
     
    abdul, Jun 7, 2007
    #3
  4. ahsan2011

    fred5152

    Joined:
    Dec 18, 2007
    Messages:
    12
    Likes Received:
    0
    if you wan to use the class in the whole application better define your class in the app_code folder
     
    fred5152, Dec 18, 2007
    #4
  5. ahsan2011

    ousrah

    Joined:
    Dec 26, 2007
    Messages:
    1
    Likes Received:
    0
    put

    val(eg12.text) + 11

    thas well go
     
    ousrah, Dec 26, 2007
    #5
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.