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

在GridView里显示表情,如何做

2012-01-01 
在GridView里显示表情,怎么做?这个是插入图片的代码functionAddText(thePicValue){document.getElementByI

在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;
}

热点排行