Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > General Computer Discussion > Software > C# asp.net

Reply
Thread Tools

C# asp.net

 
 
ahsan2011 ahsan2011 is offline
Junior Member
Join Date: Apr 2007
Posts: 2
 
      04-18-2007
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
 
Reply With Quote
 
 
 
 
Mr_helper Mr_helper is offline
Junior Member
Join Date: May 2007
Posts: 1
 
      05-12-2007
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 by Mr_helper; 05-12-2007 at 08:44 AM..
Reply With Quote
 
 
 
 
abdul abdul is offline
Junior Member
Join Date: Jun 2007
Posts: 2
 
      06-07-2007
i want to know how to include a class in asp.net 2005 framwork 2.0
 
Reply With Quote
 
fred5152 fred5152 is offline
Junior Member
Join Date: Dec 2007
Posts: 14
 
      12-18-2007
if you wan to use the class in the whole application better define your class in the app_code folder
 
Reply With Quote
 
ousrah ousrah is offline
Junior Member
Join Date: Dec 2007
Posts: 1
 
      12-26-2007
put

val(eg12.text) + 11

thas well go
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off




Advertisments