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........
啊
同意..为什么要转呢........
UP
不明白你想做啥 你不是可以直接获取到 radiobuttonid吗?
晕,没见过这么转换的。。。
想实现什么逻辑?
不能 你先用一个字符串接收radiobuttonid的值,然后再将这个字符串转换成object类型的
不能
好像以前写过,Asp.Net中单选按钮组可以实现吧
{{
相关问答:
Imports System.ComponentModel
Imports System.Web.UI
Imports System.Web.UI.Design
Imports System.Web.UI.WebControls
Namespace CBDAspNet.WebControls.HTML
''' <summary>
'' ......
最近在做个网上商城,购物车模块,没有做过,麻烦各位帮忙说下大致说下思路,能发一份源码更好。小弟先谢过各位了;
QQ:413763818;
eamil:swebook@126.com
网上一大堆!
www.51aspx.com
去下 ......
服务器现在是。net 2.0的
我现在的项目就是asp.net mvc + linq的,现在服务器的环境配置用不了。
不知道有前辈碰到过这样的问题没。
难道服务器必须要装.net3.5 和 asp.net mvc
请前辈指点
不装你认为你要怎么 ......
在asp里怎么调用java写的webservice方法,有很多方法
- <message name="RtPnrIn">
<part name="bstrPnrNO" type="s:string" />
<part name ......
万网的服务器支持伪静态的,直接用rewrite在web.config文件写规则,也不用安装组件就可以实现伪静态,但是在时代互联服务器就用不了了,咨询它的客服,他说他们服务器(基本型C)不支持伪静态的.请问一下各位我该用什么方法 ......