asp判断语句怎么写?

<%dimheadhead=request.QueryString("aa")%><%ifhead=82then%><!--#includefile="head1.asp... <% dim head
head=request.QueryString("aa")%>
<%if head=82 then %>
<!--#include file="head1.asp"-->
<%end if%>
<%if head=37 then %>
<!--#include file="headgongye.asp"-->
<%end if%>
<%if head=31 then %>
<!--#include file="headhuodong.asp"-->
<%end if%>
<%if head=88 then %>
<!--#include file="headzonghe.asp"-->
<%end if%>

当AA不等于这几个值的时候,也输出一个页面,怎么写?
http://localhost/cn/products.asp?categoryId=37& &page&aa=37

在地址里包含字段page的时候,让它调出别的东西 怎么判断?
展开
 我来答
手机用户92403
2011-05-12 · TA获得超过121个赞
知道答主
回答量:388
采纳率:0%
帮助的人:260万
展开全部
最好在客户端进行检查,在表单提交事件中执行检测
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"">

<html xmlns="">
<head>
<meta name="generator" content=
"HTML Tidy for Linux/x86 (vers 11 February 2007), see " />
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
<script >
function checkform()
{
if (document.form1.name.value=="")
{

alert('请输入用户名');
return false;
}
else if (document.form1.content.value=="")
{

alert('请输入密码');
return false;
}
// If the script gets this far through all of your fields
// without problems, it's ok and you can submit the form

return true;
}

</script>
<title>΀请输入</title>
</head>

<body>
<form name="form1" method="post" action="add_new.asp" id="form1" onSubmit="return checkform()">
帐号<input type="text" name="name"><br />
密码<input type="text" name="content" /><br />
保护<input type="text" name="title" value= "" /><br />
<input type="submit" name="Submit" value="提交" /><input type=
"reset" name="Submit2" value="重置" />
</form>
</body>
</html>
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
congqian3
2011-05-11
知道答主
回答量:26
采纳率:0%
帮助的人:0
展开全部
你的需求 最好使用 Select case 解决

<%
select case Cdbl(head)
case 82
%>
<!--#include file="head1.asp"-->
<%
case 37
%>
<!--#include file="headgongye.asp"-->
<%
case 31
%>
<!--#include file="headhuodong.asp"-->
<%
Case Else
%>
<!--#include file="??????.asp"-->
<%end select%>
追问
知道了,谢谢~~
追答
给分
本回答被提问者采纳
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
day1954
2011-05-11 · TA获得超过369个赞
知道小有建树答主
回答量:532
采纳率:100%
帮助的人:352万
展开全部
<%if head=82 then %>
<!--#include file="head1.asp"-->
<%end if%>
<%if head=37 then %>
<!--#include file="headgongye.asp"-->
<%end if%>
<%if head=31 then %>
<!--#include file="headhuodong.asp"-->
<%end if%>
<%if head=88 then %>
<!--#include file="headzonghe.asp"-->
<%else%>
<!--#include file="aaaaaaaaaaaaa.asp"-->
<%end if%>
追问
这个行不通,写了这个else, 在HEAD= 37 31 82的时候 会出现两个调用的页。
追答
可以设置一个总的IF语句
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
发物颇繁华2179
2011-05-11 · TA获得超过5.6万个赞
知道大有可为答主
回答量:2.5万
采纳率:0%
帮助的人:1910万
展开全部
对,用select case 是正确的选择
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
收起 更多回答(2)
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式