读书人

在GridView里显示表情如何做

发布时间: 2012-01-01 23:10:55 作者: rapoo

在GridView里显示表情,怎么做?
这个是插入图片的代码
function AddText(thePicValue)
{
document.getElementById( "txtContent ").innerText += thePicValue ;
}

比如一个文本插入了图片的样子大概是这样

这是一个秋天,[image01],风儿那么缠绵,[image02],让我想起他们,那双无助的眼![image03]

然后这段话 显示在GridView的表格中 时候 ,怎么实现插入图片 比如图片地址 ImageUrl+image01.jpg



[解决办法]
用标记替换,原来的文本中显示的比如时 <smile> 标记,再将其转换为相应的图片
[解决办法]
比如
<%#GetImage(Eval( "字段 ").ToString())%>

protected string GetImage(string str)
{
str = str.replace( " <smile> ", " <img src= 'smile.gif '> ");
return str;
}

读书人网 >asp.net

热点推荐