if DateDiff("d",vEditTime,date())<1 then Response.Write"<img src=images/new.gif border=0>"
<% if DateDiff( "d ",vEditTime,date()) <1 then Response.Write " <img src=images/new.gif border=0> "
%> 在.net 中怎么表示呢,用什么函数呢?望大家帮帮忙,谢谢!!
------解决方案--------------------TimeSpan ts = (TimeSpan)(DateTime.Now-vEditTime);
if(ts.TotalDays <1)
{
this.Literal1.innerHTML = " <img src=images/new.gif border=0> ";
}
------解决方案--------------------写个后台函数:
public void ShowNew(DateTime dt)
{
string strImg = " <img src= './images/new.gif ' /> ";
if(DataTime.Now - dt <= 3)
{
Response.Write( "strImg ");
}
}
然后前台调用这个函数就可以了,大概就是这个意思。