您现在的位置: 无忧电子商务网 >> 信息学院 >> 程序开发 >> asp >> 正文

Asp深度揭密(上)

作者:佚名    信息学院来源:整理    点击数:    更新时间:2008-1-24 我要参与讨论

  d-color: #FFFFFF; border-bottom: black 1px solid;border-left: black 1px solid; border-right: black 1px solid;border-top: black 1px solid; color: #000000;font-family: Georgia; font-size: 9pt;color: midnightblue;}
a:link {color: #1B629C; text-decoration: none}
a:hover {color: #FF6600; text-decoration: underline}
a:visited {text-decoration: none}
-->
</style>

<center>
<form name="course" action="request_form.asp" method="post">
User_id:<input type="text" name="user_id" maxlength="20" class="input"><br><br>
User_name:<input type="text" name="user_name" maxlength="30" class="input">
</form>
<br><br>
<a href="javascript:document.course.submit();"> 提 交 </a>
</center>

request_form.asp
<%
'获取用户输入,并存入变量
user_id=request.form("user_id")
user_name=request.form("user_name")

'判断用户输入是否正确
if user_id="" then
response.write "User_id is null,please check it"
response.end
end if
if user_name="" then
response.write "User_name is null,please check it"
response.end
end if

'打印变量
response.write user_id&"<br>"
response.write user_name
%>

注意:form的action的指向,request_form.asp和request_url.asp在源代码上的区别?

2. Response:

定义:用来向浏览器回发信息,可用此对象从脚本向浏览器发送输出。

集:
Cookies:在浏览器中加入一个cookie

方法:
End:结束脚本的处理
Redirect:将浏览器引导至新页面
Write:向浏览器发送一个字符串

属性:
Buffer:缓存一个ASP
CacheControl:由代理服务器控制缓存
ContentType: 规定响应的内容类型
Expires:浏览器用相对时间控制缓存
ExpiresAbsolute:浏览器用绝对时间控制缓存

例子:

response_redirect.asp
<%
'去googl

上一页  [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] 下一页

在google里搜索更多Asp深度揭密(上)

Google
Web www.51ec.org
  • 上一篇信息学院:

  • 下一篇信息学院:
  • 【字体: 】【发表评论】【加入收藏】【告诉好友】【打印此文】【关闭窗口
    我来说两句 对此文章发表了评论
      昵 称: *必填    ·注册用户·
      评 分: 1分 2分 3分 4分 5分     严禁发表危害国家安全、政治、黄色淫秽等内容的评论,用户需对自己在使用本网站服务过程中的行为承担法律责任。本站管理员有权保留或删除评论内容,评论内容只代表机友个人观点,与本网站立场无关。  
    评 论
    内 容

     
    评论列表 (最新 评论仅限网友观点!)

    供求信息




    | 设为首页 | 加入收藏 | 关于我们 | 广告服务 | 联系方式 | 友情链接 | 版权申明