if the value is 0..
-
hi all.. thanks for the attention to this post.. i am facing some difficulty with my project and i need help. example, i have 3 textboxes (unitPrice, quantity and grandTotal) and a button (nextBtn). when the application is running, the user will key in some value inside unitPrice and quantity (for multiplication).. and the grandTotal will auto compute the product. (this has been done.) Now, the thing is, when i click on the "Next" button, i want the browser to compare the value at the grandTotal TextBOx.. if the value is 0.00, it will redirect me to PAGE1. if the value is more than 0.00, it will redirect me to PAGE2. i've tried various ways (Using if.. else.. loop) but it seems to have some problem.. does anyone know how to solve this problem..? i need help here.. using asp .net 2.0, visual studio 2005, c# -DarkangeL-
-
hi all.. thanks for the attention to this post.. i am facing some difficulty with my project and i need help. example, i have 3 textboxes (unitPrice, quantity and grandTotal) and a button (nextBtn). when the application is running, the user will key in some value inside unitPrice and quantity (for multiplication).. and the grandTotal will auto compute the product. (this has been done.) Now, the thing is, when i click on the "Next" button, i want the browser to compare the value at the grandTotal TextBOx.. if the value is 0.00, it will redirect me to PAGE1. if the value is more than 0.00, it will redirect me to PAGE2. i've tried various ways (Using if.. else.. loop) but it seems to have some problem.. does anyone know how to solve this problem..? i need help here.. using asp .net 2.0, visual studio 2005, c# -DarkangeL-
post your code then it can be fix it easily. Regards R.Arockiapathinathan
-
post your code then it can be fix it easily. Regards R.Arockiapathinathan
-
the If.. Else.. code is this..
if (gtTextBox.Text == "0") { Server.Transfer("TBFund.aspx"); } else { Server.Transfer("MainPage.aspx"); }
but somehow there is some error with it.. -DarkangeL-You required numeric comparison instead of string comparison, so change the coding like follows:
if (int.Parse(gtTextBox.Text) == 0) { Server.Transfer("TBFund.aspx"); } else { Server.Transfer("MainPage.aspx"); }
Regards R.Arockiapathinathan -
You required numeric comparison instead of string comparison, so change the coding like follows:
if (int.Parse(gtTextBox.Text) == 0) { Server.Transfer("TBFund.aspx"); } else { Server.Transfer("MainPage.aspx"); }
Regards R.Arockiapathinathan