首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > asp.net >

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

2012-03-16 
空格在textBox上显示 的值,如何处理protected void GridView1_SelectedIndexChanged(object sender, Event

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

热点排行