| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 605 人关注过本帖
标题:请求把if else 改为select case 的
只看楼主 加入收藏
lendy
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2007-8-18
收藏
 问题点数:0 回复次数:1 
请求把if else 改为select case 的
请求把if else 改为case 的,因为我要多加几个模板,初学者请帮忙。

<%
sqlInfo = "Select * From Moban Where State=0 ID="&cid
crs.Open sqlInfo,Conn,1,1
if not crs.eof then
mb=crs("mb")
if mb="2" then
Response.Redirect "company2.asp?cid="&cid&""
else if mb="3" then
Response.Redirect "style03/company1.asp?cid="&cid&""
else
Response.Redirect "company1.asp?cid="&cid&""
end if
end if
else
response.write"<SCRIPT language=JavaScript>alert('不存在的单位!');"
response.write"javascript:history.go(-1) ;</SCRIPT>"
end if
crs.close
set crs=nothing
conn.close
set conn=nothing
%>
搜索更多相关主题的帖子: case else select 请求 
2007-08-18 13:33
yms123
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:209
帖 子:12488
专家分:19042
注 册:2004-7-17
收藏
得分:0 
<%
sqlInfo = "Select * From Moban Where State=0 ID="&cid
crs.Open sqlInfo,Conn,1,1
if not crs.eof then
mb=crs("mb")
Select Case mb
Case "2"
Response.Redirect "company2.asp?cid="&cid&""
Case "3"
Response.Redirect "style03/company1.asp?cid="&cid&""
Case Else
Response.Redirect "company1.asp?cid="&cid&""
End Select
Else
response.write"<SCRIPT language=JavaScript>alert('不存在的单位!');"
response.write"javascript:history.go(-1) ;</SCRIPT>"
End if
crs.close
set crs=nothing
conn.close
set conn=nothing
%>
2007-08-18 16:37
快速回复:请求把if else 改为select case 的
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.016545 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved