当前位置: 代码迷 >> ASP.NET >> asp.net值,该怎么处理
  详细解决方案

asp.net值,该怎么处理

热度:1159   发布时间:2013-02-25 00:00:00.0
asp.net值
public String name
  {
  set { this._name = value; }
  get 
  {
  string newName = this._roomId.ToString() + "号楼:" + this._name;
  return newName;
  }
  }

  ut.roomId = Room_Value;
  ut.name = name_Value;
  ut.ctrlType = ctrlType_Value;
  ut.delay = delay_Value;
为什么ut.name的值会有个固定值,ut.name = name_Value;左右不相等,会在前门加入了几号楼,如何改不要让他加

------解决方案--------------------------------------------------------
去掉楼号呗

public String name
{
set { this._name = value; }
get
{
return this._name;
}
}
------解决方案--------------------------------------------------------
有没有构造函数?
------解决方案--------------------------------------------------------
探讨

去掉楼号呗

public String name
{
set { this._name = value; }
get
{
return this._name;
}
}

------解决方案--------------------------------------------------------
get 方法已经重新赋值了,而并不是返回set当中的值。
  相关解决方案