日期:2014-05-18  浏览次数:20443 次

空格在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);