当前位置: 代码迷 >> ASP.NET >> 空格在textBox上显示 的值,如何避免
  详细解决方案

空格在textBox上显示 的值,如何避免

热度:2097   发布时间:2013-02-25 00:00:00.0
空格在textBox上显示 的值,如何处理
protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
  {
  GridViewRow row = GridView1.SelectedRow;
  this.txtNAMEID.Text = row.Cells[0].Text;
  this.txtNAME.Text = row.Cells[1].Text;
  this.txtuserclass.Text = row.Cells[2].Text;
  this.txtRoleID.Text = row.Cells[3].Text;
  this.txtrolename.Text = row.Cells[4].Text;
  this.txtAY001.Text = row.Cells[5].Text;
  this.txtREMARK.Text = row.Cells[6].Text;
  }
以上是我的代码,如果row.cells[].Text的值是空白, 在textBox上显示  好难看,怎么能变成空白呢

------解决方案--------------------------------------------------------
C# code
this.txtrolename.Text =HttpUtility.HtmlDecode(row.Cells[4].Text);
  相关解决方案