zoukankan      html  css  js  c++  java
  • ASP Response 对象

    1:在 ASP 中使用 HTML 标签格式化文本

    <html>
    <body>
    <%
    response.write("<h2>您可以使用 HTML 标签来格式化文本</h2>")
    %>


    <%
    response.write("<p style='color:#0000ff'>这段文本的样式是通过 style 属性添加的。</p>")
    %>

    </body>
    </html>

    <%
    if Request.Form("select")<>"" then
           Response.Redirect(Request.Form("select"))
    end if
    %>
      
    2:将用户重定向至不同的 URLs
    <html>
    <body>

    <form action="/example/aspe/demo_aspe_redirect.asp" method="post">

    <input type="radio" name="select"
    value="/example/aspe/demo_aspe_server.asp">
    服务器实例<br />

    <input type="radio" name="select"
    value="/example/aspe/demo_aspe_text.asp">
    文本实例<br /><br />
    <input type="submit" value="跳转!">

    </form>

    </body>
    </html>

    3:显示随机的链接

    <html>
    <body>

    <%
    randomize()
    r=rnd()
    if r>0.5 then
      response.write("<a href='http://www.w3school.com.cn'>W3School.com.cn!</a>")
    else
      response.write("<a href='http://www.news.cn'>news.cn!</a>")
    end if
    %>

    4:本例演示如何清空缓存。

    <%
    Response.Buffer=true
    %>

    <html>
    <body>
    <p>
    当您的 response 缓存清空时,这段文本就会发送到浏览器。
    </p>
    <%
    Response.Flush
    %>

    </body>
    </html>

    <p>
    本例演示一个链接,每当您加载本页时,就会显示两个链接之一:W3School.com.cn! 或 news.cn!各占百分之五十的几率。
    </p>

    </body>
    </html>

    5:<%
    Response.End
    %>

    6:

    <%
    Response.ExpiresAbsolute=#May 05,2001 05:30:30#
    %>

    7:<%Response.Expires=-1%>
    <html>
    <body>
    <p>每当被访问,本页都会被刷新!</p>
    </body>
    </html>

    8:

    <html>
    <body>

    <%
    If Response.IsClientConnected=true then
    Response.Write("用户仍然保持连接。")
    else
    Response.Write("用户未连接。")
    end if
    %>


    </body>
    </html>

    9:

    <%
    Response.ContentType="text/html"
    %>

    <html>
    <body>

    <p>This is some text.</p>

    </body>
    </html>

    10:

    <%
    Response.Charset="ISO8859-1"
    %>

    <html>
    <body>

    <p>This is some text</p>

    </body>
    </html>

  • 相关阅读:
    MS SQL Server 定时任务实现自动备份
    Python日期的加减等操作
    C# DbHelperSQL 类,从东软生成器提取而来
    C# List<string>和ArrayList用指定的分隔符分隔成字符串
    自定义可视化调试工具(Microsoft.VisualStudio.DebuggerVisualizers)
    查看SQLServer最耗资源时间的SQL语句
    程序员不适合创业
    如何写高质量,不繁琐的会议记录?
    C#中的Attribute详解(下)
    微信小程序教程系列
  • 原文地址:https://www.cnblogs.com/secying/p/2317289.html
Copyright © 2011-2022 走看看