ASP.NET关于强制转换问题 - .NET技术 / ASP.NET
3个radioButton 一个Button 一个label C# code: protected void Button1_Click(object sender, EventArgs e) { string str = null; RadioButton rdo=(RadioButton)sender; if (rdo.Checked == true) { str = rdo.Text; } Label1.Text = str; } 报错:无法将类型为“System.Web.UI.WebControls.Button”的对象强制转换为类型“System.Web.UI.WebControls.RadioButton”。 ASP.NET不能像我用C#做form那样强制转换的么?
两种不同的类型哦!! 不能转换!! if (this.radiobuttonid.Checked == true) 不能转换 这个真不行,就好像你把字符串“哈哈”转换成数字一样,没法转 buxing........ 啊引用 if (this.radiobuttonid.Checked == true) 同意..为什么要转呢........引用 if (this.radiobuttonid.Checked == true) UP 不明白你想做啥 你不是可以直接获取到 radiobuttonid吗? 晕,没见过这么转换的。。。 想实现什么逻辑? 不能 你先用一个字符串接收radiobuttonid的值,然后再将这个字符串转换成object类型的 不能 好像以前写过,Asp.Net中单选按钮组可以实现吧 {{
相关问答:
http://www.zgjhjy.com/Test/PrimaryTest/Index.aspx 就是类似以上的在线测试系统,需要有一个后台的,语言是asp的,数据库是access的,还需要能在后台对信息进行添删改查的。谢谢各位了。。。 程序真的很多,不知 ......
select top 12 * from Product where [id] not in (select top 12 [id] from Product) 这样可以分页,但是我在后面想加个条件 select top 12 * from Product where [id] not in (select top 12 [id] from Prod ......
服务器现在是。net 2.0的 我现在的项目就是asp.net mvc + linq的,现在服务器的环境配置用不了。 不知道有前辈碰到过这样的问题没。 难道服务器必须要装.net3.5 和 asp.net mvc 请前辈指点 不装你认为你要怎么 ......
C# code: SqlConnection conn = CsDB.sqlcon(); SqlDataAdapter da = new SqlDataAdapter("select fwCoding from bjmuma_fwCoding where OrderNumber='" + Order + & ......
万网的服务器支持伪静态的,直接用rewrite在web.config文件写规则,也不用安装组件就可以实现伪静态,但是在时代互联服务器就用不了了,咨询它的客服,他说他们服务器(基本型C)不支持伪静态的.请问一下各位我该用什么方法 ......