今天在ASP中使用replace时,出现这样的错误:无效使用 Null: 'replace' 。
replace的语法本站有:http://www.w17x.com/AritcleDisplay.aspx?id=453
写法就是:html=replace(html,"{$content}",content)
再看看提示说无效使用 Null,这里有两个变量,一个就是HTML,还有个就是content,html这个有内容,只有content是从数据库里读出来的。
可能数据的记录为null。所以解决办法
在html=replace(html,"{$content}",content)这句前加上
if isnull(content) then contnet=""
这样,就不会出现错误了。
还有种就是html=replace(html,"{$content}",""&content&"")