Search code examples
c#asp.net-3.5

ASP.Net checkbox to return a "Yes" or "No" value (instead of True / False)


I am using C# and ASP.Net 3.5, and trying to get a "Yes" / "No" value from checkbox, rather than a True / False. Is there an easy way or do I need to do "if" statements?


Solution

  • sure try this:

    string doesThisWork = chkBox.Checked ? "Yes":"No"
    

    more info...