This is a migrated thread and some comments may be shown as answers.

cant get the boolean value to work

1 Answer 74 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
rob mays
Top achievements
Rank 1
rob mays asked on 20 Jun 2007, 11:55 AM
the code is below, getting the value of txtOtherNumber.Value works fine but txtPreferHome.Value and txtPrefer.Value are either True or False but I am not getting the value into my variables. So if something is false I want to populate a textbox on the form with a different value that has come back from the database?
code

if (txtOtherNumber.Value.StartsWith("type"))

{

txtOtherNumber.Value = string.Empty;

}

string preferHome = txtPreferHome.Value;

string preferOther = txtPreferOther.Value;

string homeNumber = txtHomeNumber.Value;

string otherNumber = txtOtherNumber.Value;

//Tom wants the prefer contact number at the top

if (txtPreferHome.Value == "False"))

{

txtHomeNumber.Value = otherNumber;

txtOtherNumber.Value = homeNumber;

txtPrefer.Value = "Some Value";

}

1 Answer, 1 is accepted

Sort by
0
Chavdar
Telerik team
answered on 20 Jun 2007, 03:25 PM
Hi Rob,

Thank you for posting your code. Unfortunately, it's difficult to tell where exactly the problem is in these lines. Could you specify at what moment this code is executed and exactly which part doesn't work correctly? Thanks in advance.

 
All the best,
Chavdar
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
General Discussions
Asked by
rob mays
Top achievements
Rank 1
Answers by
Chavdar
Telerik team
Share this question
or