我想判断session中是否等于 字符A,该如何判断 我想判断session中是否等于 字符a,该如何判断string tp=Session["select" + id].ToString() ;if (tp == 'A') { this.RadioButton1.Checked = true; } 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 你是什么需求?session储存单选框状态? string tp=Session["select" + id].ToString() ;if (tp == 'A') { this.RadioButton1.Checked = true; }if (tp == 'B') { this.RadioButton2.Checked = true; }if (tp == 'C') { this.RadioButton3.Checked = true; }if (tp == 'D') { this.RadioButton4.Checked = true; } 断点查看string tp=Session["select" + id].ToString() 两边的值。特别是Session["select" + id].ToString() 显示无法调试 windows集成验证失败 System.NullReferenceException: 未将对象引用设置到对象的实例。源错误: 行 31: tp = Session["select" + id].ToString(); string tp=Session["select" + id].ToString() ;if (tp == "A") { this.RadioButton1.Checked = true; }就这样判断,A写成字符串格式。 string curKey = "select" + id;if(Session[curKey != null){string tp=Session[].ToString() ;if (tp == 'A') { this.RadioButton1.Checked = true; }} string curKey = "select" + id;if(Session[curKey] != null){string tp=Session[curKey].ToString() ;if (tp == 'A') { this.RadioButton1.Checked = true; }} to 11楼编译器错误消息: CS0019: 运算符“==”无法应用于“string”和“char”类型的操作数 if (tp == "A") { this.RadioButton1.Checked = true; }if (tp == "B") { this.RadioButton2.Checked = true; }if (tp == "C") { this.RadioButton3.Checked = true; }if (tp == "D") { this.RadioButton4.Checked = true; }你真的遇到一下开一帖请自己认真思考一下 自己解决一下问题学会学习是非常重要的 if(tp=="A")用双引号,不要用单引号 string a=session["select"].tostring();string aa=合并a+id然后判断呗 if(Session["select" + id] !=null){string tp=Session["select" + id].ToString() ;if (tp == 'A') { this.RadioButton1.Checked = true; }} 每隔一秒向listbox添加一项,怎么实现啊 大家帮忙测试下 我刚写的用来采集网页的类库 请问Clipboard中从网页上复制的内容时,通过GetData(DataFormats.Html)获取的文本是什么编码的?怎样知道? SQL问题 求版本控制解决方案,internet团队协作开发。 怎么读出数据库字段的长度?? 关于水晶报表分组的问题(急,急) 急..gridview中的2個下拉菜單 真要命啊! 为什么 datagrid 里的 anchor 绑定了等于没绑定? ?????????? 请教一个菜鸟问题。 求助 vs的chart控件问题 三层分别怎么引用
if (tp == 'A') { this.RadioButton1.Checked = true; }
if (tp == 'B') { this.RadioButton2.Checked = true; }
if (tp == 'C') { this.RadioButton3.Checked = true; }
if (tp == 'D') { this.RadioButton4.Checked = true; }
if (tp == "A") { this.RadioButton1.Checked = true; }就这样判断,A写成字符串格式。
string curKey = "select" + id;
if(Session[curKey != null)
{
string tp=Session[].ToString() ;
if (tp == 'A') { this.RadioButton1.Checked = true; }
}
string curKey = "select" + id;
if(Session[curKey] != null)
{
string tp=Session[curKey].ToString() ;
if (tp == 'A') { this.RadioButton1.Checked = true; }
}
编译器错误消息: CS0019: 运算符“==”无法应用于“string”和“char”类型的操作数
if (tp == "B") { this.RadioButton2.Checked = true; }
if (tp == "C") { this.RadioButton3.Checked = true; }
if (tp == "D") { this.RadioButton4.Checked = true; }你真的遇到一下开一帖
请自己认真思考一下 自己解决一下问题学会学习是非常重要的
if(tp=="A")
用双引号,不要用单引号
string aa=合并a+id然后判断呗
{string tp=Session["select" + id].ToString() ;
if (tp == 'A') { this.RadioButton1.Checked = true; }
}