Oh never mind.. I was trying to convert it in VB.Net :-(
-----Original Message-----
From: Dwayne Hope [mailto:[EMAIL PROTECTED]
Sent: Saturday, April 02, 2005 5:52 PM
To: [email protected]
Subject: Re: [AspNetAnyQuestionIsOk] Problem while converting the value
of a text box
txt_TotalCostB4Vat.Text = ((Convert.ToInt32(txt_NoOfNights.Text)) *
(Convert.ToInt32(txt_RoomRate.Text))).ToString()
More readable
try
{
Int32 noNights = Convert.ToInt32(txt_NoOfNights.Text);
Int32 noRoomMates = Convert.ToInt32(txt_RoomRate.Text);
txt_TotalCostB4Vat.Text = (noNights * noRoomMates).ToString();
}
catch
{//one of the values is non-numeric}
with C#, casting is explicit. the int must be cast to a string.
HTH
Dwayne
Arindam <[EMAIL PROTECTED]> wrote:
Can anyone rectify the statement bellow.
I have tried "Convert.ToInt32", "(int)" casting etc. to make the value
numeric,
so i can do calculation.
DONT tell me "eval" function of JavaScript, I want to write everything
in my codebehind file.
txt_TotalCostB4Vat.Text= (int.Parse(txt_NoOfNights.Text)) *
(int.Parse(txt_RoomRate.Text))
Thanks
Thanks & Regards
Arindam
Web Designer & Developer
Yahoo! India Matrimony: Find your life partneronline.
[Non-text portions of this message have been removed]
---------------------------------
Yahoo! Groups Links
To visit your group on the web, go to:
http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/
To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
[Non-text portions of this message have been removed]
_____
Yahoo! Groups Links
* To visit your group on the web, go to:
http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/
* To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]
cribe>
* Your use of Yahoo! Groups is subject to the Yahoo! Terms of
Service <http://docs.yahoo.com/info/terms/> .
[Non-text portions of this message have been removed]
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/