PC6下载站

分类分类

Response对象1

关注+2004-11-07作者:蓝点

Response对象非常重要,而且有许多特性。我们将关注其最常用的一些功能。可用于

80%场合的20%的功能。



response.write

response.write的变体 <%= %>它可使ASP方便地插入HTML中

response.end which 有效地中止代码

response.redirect 调用其它页面

下面是一个实例,用response.write发送信息到浏览器。同时用到了dateadd,一个

内建功能,相关文档在:

http://help.activeservERPages.com/iishelp/VBScript/htm/vbs90.htm.





response.asp&



<%

when=now()

tommorow=dateadd("d",1,when)

twoweekslater=dateadd("ww",2,when)

fourteenweekdayslater=dateadd("w",14,when)

monthlater=dateadd("m",1,when)



sixminuteslater=dateadd("n",6,when)

sixhourslater=dateadd("h",6,when)

fortysecslater=dateadd("s",40,when)



response.write "Now " & when & "
"

response.write "tommorow " & tommorow & "
"

response.write "2 weeks from Now " & twoweekslater & "
"

response.write "fourteen working days from Now " &

fourteenweekdayslater & "

"

response.write "1 month from Now " & monthlater & "
"

%>

six minutes from now <%=sixminuteslater%>


six hours from now <%=sixhourslater%>


fourty seconds later <%=fortysecslater%>










下面是用response.end终止一个页面操作:





end.asp&



<%

when=now()

tommorow=dateadd("d",1,when)

twoweekslater=dateadd("w",2,when)

monthlater=dateadd("m",1,when)

sixminuteslater=dateadd("n",6,when)

sixhourslater=dateadd("h",6,when)



response.write "Now " & when & "
"

response.write "1 month from Now " & monthlater & "
"

response.end

response.write "2 weeks from Now " & twoweekslater & "
"

%>

six minutes from now <%=sixminuteslater%>


six hours from now <%=sixhourslater%>



展开全部

相关文章

更多+相同厂商

热门推荐

  • 最新排行
  • 最热排行
  • 评分最高
排行榜

    点击查看更多

      点击查看更多

        点击查看更多

        说两句网友评论

          我要评论...
          取消