如何判断Control型对象属于哪个类型 Response.Write(LabelId.ToString())Response.Write("<br>")Response.Write(LabelId.GetType()) 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 不好意思 这个我不是很明白我这样写的IF objControl = TextBox then a()else b()end if但是报错,原因在那里? tryobjControl = TextBox ----> objControl is TextBox if(ctl is TextBox)...else if(ctl is LinkButton).... if(ctl.ToString()=="System.Web.UI.Controls.TextBox")....else if(ctl.ToString()=="System.Web.UI.Controls.Label").... 或者可以用一下这个if(Object.Equals(ctl,System.Web.UI.Controls.TextBox)).......... 我认为xiahouwen(活靶子.NET)说得是正确的,报什么错?贴出来啊. xiahouwen(活靶子.NET)说得没错,用 is 最合适。 string fileName = str.Substring(str.LastIndexOf("\\") + 1); 很喜欢一个网站系统,不过没有源码,请教反编译方法 用C#在webform上画直线(像Excel一样可拖动)? [2008/07/03]code 求一SQL语句 高分请教 存储过程分页问题 在线======= 带域的windows2003上IIS无法显示aspx内容 listbox的选择 vs2005的asp.net网站怎么没有bin文件夹了? 急啊。。急啊。。请教如果在几天内学成美工?答者有分 [孟子e章]先生请进,关于分页问题 关于日期的一个问题(在线等)
这个我不是很明白
我这样写的
IF objControl = TextBox then
a()
else
b()
end if
但是报错,原因在那里?
objControl = TextBox ----> objControl is TextBox
...
else if(ctl is LinkButton)
....
....
else if(ctl.ToString()=="System.Web.UI.Controls.Label")
....
......
....
贴出来啊.