·您的位置: 首页 » 资源教程 » 编程开发 » ASP » RESPONSE对象3

RESPONSE对象3

类别: ASP教程  评论数:0 总得分:0
Response对象可以决定接下来向浏览器发送什么页面。这就是response.redirect的
功用所在。我们创建了一个代码文件script formjump.asp来演示这种方法

<html><head>
<TITLE>FormJump.asp</TITLE>
</head><body bgcolor="#FFFFFF">
<form action="FormJumpRespond.asp" method="get">
<SELECT NAME="wheretogo">
<OPTION SELECTED VALUE="fun">Fun</OPTION>
<OPTION value="news">Daily News</OPTION>
<OPTION value="docs">ASP IIS3 Roadmap/Docs</OPTION>
<OPTION value="main">MainPage of ActiveServerPages.com</OPTION>
<OPTION value="sample">IIS 3 Sample ASP scripts</OPTION>
</SELECT>
<input type=submit value="Choose Destination">
</form>
</body></html>

表单的反馈如下:

<%response.buffer=true%>
<html><head>
<title>formjumprespond.asp</title>&
<body bgcolor="#FFFFFF">
<%
\' My ASP program that redirects to URL
thisURL="http://www.4ico.com"
where=Request.QueryString("Wheretogo")
Select Case where
case "main"
response.redirect thisURL & "/"
case "samples"
response.redirect thisURL & "/aspsamp/samples/samples.htm"
case "docs"
response.redirect thisURL & "/iasdocs/aspdocs/roadmap.asp"
case "news"
response.redirect "http://www.4ico.com"
case "fun"
response.redirect "http://4ico.com"
End Select
response.write "All dressed up and I don\'t know where to go<br>"
response.write "I recommend --> " & "<br>"
response.write server.htmlencode(thisURL & "/learn/test/res2.asp?
where=fun") & "<br>"
response.write "for a good laugh!" & "<P>"
%>
</body></html>
-= 资 源 教 程 =-
文 章 搜 索
关键词:
类型:
范围:
纯粹空间 softpure.com
Copyright © 2006-2008 暖阳制作 版权所有
QQ: 15242663 (拒绝闲聊)  Email: faisun@sina.com
 纯粹空间 - 韩国酷站|酷站欣赏|教程大全|资源下载|免费博客|美女壁纸|设计素材|技术论坛   Valid XHTML 1.0 Transitional
百度搜索 谷歌搜索 Alexa搜索 | 粤ICP备19116064号-1