当前位置: 代码迷 >> ASP.NET >> 这个返回类型如何写呢
  详细解决方案

这个返回类型如何写呢

热度:7279   发布时间:2013-02-25 00:00:00.0
这个返回类型怎么写呢
有一个方法,会返回TextBox或RadioButtonList或DropDownList等web控件,那么类型应该写什么呢?
有无可能做到呢?

public ??? GetWebControl

------解决方案--------------------------------------------------------
public Control GetWebControl
------解决方案--------------------------------------------------------
Control
------解决方案--------------------------------------------------------
public Control GetWebControl()
{
你的实现代码;
}

Control c= GetWebControl();
if(c is TextBox)
{
TextBox tb = c as TextBox;
}
  相关解决方案