cant get the boolean value to work

2 posts, 0 answers
  1. rob mays
    rob mays avatar
    58 posts
    Member since:
    Jun 2007

    Posted 20 Jun 2007 Link to this post

    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";

    }

  2. Chavdar
    Admin
    Chavdar avatar
    898 posts

    Posted 20 Jun 2007 Link to this post

    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
  3. DevCraft banner
Back to Top