复选框代码 [英] code for checkbox
本文介绍了复选框代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我使用此代码来选中复选框...
I use this code to check the checkbox...
thpizzaInfo.IsFavourite = Convert.ToBoolean(chkIsFavourite.Text);
它给出了一个错误,我不确定如何调用它
无法将字符串识别为有效的布尔值
It gives an error and I am not sure how to call it
String was not recognized as a valid Boolean
推荐答案
try:
try :
thpizzaInfo.IsFavourite = chkIsFavourite.Checked;
在此处查看更多信息: http://www.w3schools.com/aspnet/control_checkbox.asp
see more here : http://www.w3schools.com/aspnet/control_checkbox.asp
这篇关于复选框代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文