Help Please!!

Results 1 to 2 of 2

Thread: Help Please!!

  1. #1
    Join Date
    Dec 1969

    Default Help Please!!

    Thanks for taking time to read this! I have this piece of code here. <BR><BR>private void Convert_Click(object sender, System.EventArgs e)<BR> {<BR> //CustomValidator cv;<BR> TextBox FromText, ToText, Rate;<BR> <BR> FromText = (TextBox) ConvertFrom.FindControl("ConvertFrom");<BR> ToText = (TextBox) ConvertTo.FindControl("ConvertTo");<BR> Rate = ((TextBox) RateInput.FindControl("RateInput")).g;<BR><BR> if(FromText.Text != string.Empty)<BR> {<BR> ToText = FromText * Rate;<BR> }<BR> }<BR><BR><BR>How can I get the int or decimal values from the textbox, and do a multiplication? Thanks!

  2. #2
    Join Date
    Dec 1969

    Default RE: Help Please!!

    You Must use the relevant property, and then convert that property to the relevant type...<BR><BR>if(FromText.Text != string.Empty)<BR>{<BR>ToText.Text = (Convert.ToDouble(FromText.Text) * Convert.ToDouble(Rate.Text)).ToString();<BR>}<BR>}

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts