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中单选按钮组可以实现吧 {{
相关问答:
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 ......
最近在做个网上商城,购物车模块,没有做过,麻烦各位帮忙说下大致说下思路,能发一份源码更好。小弟先谢过各位了; QQ:413763818; eamil:swebook@126.com 网上一大堆! www.51aspx.com 去下 ......
我一个项目,有个插入操作,具体是这样的: 我有进货信息表。在出货时选择相应的进货信息,输入数量,选择部门后,点保存按钮,由于网络延时,点一下没有反映,于是用户就又点一下,导致一次插入了两条记录: 例:
......
调整了这里,那里出问题。 有没有什么好的方法,像调整对话框一样???? 找个专门做页面的 在dreamweaver里调。。。也可以直接控制HTML代码 确实痛苦 感同身受呀 哈哈 坚决路过。 用DW吧,VS搞设计 ......