检查多个控件的值-如果为true复选框 [英] Check the value of multiple controls - If true checkbox
问题描述
我正在尝试编写代码,以检查所有这些字段是否都具有值的复选框
文字txtSSN.Text =
文本txtMemberConfirmed.Text =
文字txtDateOfBirth.Text =
下拉列表ddlClearanceITem.SelectedValue =
下拉列表ddlVisitorRqClose.SelectedValue =
复选框chkClientSiteAccess1.Checked =
复选框chkBadgeIssued1.Checked =
复选框chkKeysIssued1.Checked =
复选框chkDeskKeys.Checked =
I''m trying to write code that checks a checkbox if all of these fields have a value
Text txtSSN.Text =
Text txtMemberConfirmed.Text =
Text txtDateOfBirth.Text =
Dropdown List ddlClearanceITem.SelectedValue =
Dropdown List ddlVisitorRqClose.SelectedValue =
Checkbox chkClientSiteAccess1.Checked =
Checkbox chkBadgeIssued1.Checked =
Checkbox chkKeysIssued1.Checked =
Checkbox chkDeskKeys.Checked =
推荐答案
您遇到了什么问题?
单个If
语句具有大量测试:
What are you stumped on?
A singleIf
statement with a lot of tests:
if ((textSSN.Text.Length > 0) && (txtMemberConfirmed.Text.Length > 0) && ...)
{
//check the checkbox
}
else
{
//uncheck the checkbox
}
非常感谢您的回复.
我在文本和下拉列表的语法上遇到错误.
应当如何说明下拉列表的语法?
thank you very much for responding.
I''m getting errors on the syntax for the text and the dropdownlist.
How should the syntax for the dropdownlist be stated?
这篇关于检查多个控件的值-如果为true复选框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!