日期:2014-05-18  浏览次数:20390 次

字符串转换为bool值
Boolean.Parse(this.RadioButtonList2.SelectedValue.ToString());
为什么说该字符串未被识别为有效的布尔值,


------解决方案--------------------
if( "true ".equals(this.RadioButtonList2.SelectedValue.ToString())) {

bool bo = Convert.ToBoolean( "true ");

} else if ( "false ".equals(this.RadioButtonList2.SelectedValue.ToString())) {

bool bo = Convert.ToBoolean( "false ");

}