ASP问题(100分)

  • 主题发起人 主题发起人 zhaowujun
  • 开始时间 开始时间
Z

zhaowujun

Unregistered / Unconfirmed
GUEST, unregistred user!
我对ASP不熟悉!下面这段李维书上的ASP的一段代码,可是执行起来有问题
我希望以PageCode为标志区分我想打开哪一页,可是没有用,这段代码只会
顺序执行,一直打开的是都是getaspobj().GetDepartmentPage(getthisurl());
的主页内容!我不知道错误可能在哪里?

//从QueryString中取出主页代号
function getpagecode()
{
if (Request.QueryString('PageCode').Count > 0)
return Request.QueryString('PageCode')(1);
else
return '';
}

//==========================================================================
//主程序
//==========================================================================
if (isapplyupdatesrequest())
{
//更新数据封包
if (getaspobj().ApplyUpates() <= 0)
Response.redirect(getthisurl());
Response.write('没有错误');
}
else
{
//选择显示的是哪一页?
switch (getpagecode())
{
case '' :
getaspobj().GetDepartmentPage(getthisurl());
break;
case '1' :
getaspobj().GetMainPage(getthisurl());
break;
default :
getaspobj().GetMainPage(getthisurl());
}
}
%>
 
[:(]
怎么没人会解决啊??????????
好失望!主啊!救救我吧!!!!!!!!!!!!!!
 
return Request.QueryString('PageCode')(1);?
是这么写的么?
 
立维老先生就是这么写的啊!!!难道????????晕!
 
asp分页:
<html>

<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>管理员</title>
<style>
P {
COLOR: #000000; FONT-SIZE: 9pt; LINE-HEIGHT:12pt
}
A:hover {
COLOR: #ff00ff;text-decoration:none
}
A:link {
COLOR: #000000;text-decoration:none
}
A:visited {
COLOR:#000000;text-decoration:none
}
TD {
font-size:9pt
}
</style>

</head>

<body topmargin=1>
<div align="center">
<center>
<table border="0" width="755" cellspacing="0" cellpadding="0" height="60">
<tr>
<td width="307">
<p align="center"><a href="index.asp"><img border="0" src="index.jpg" width="300" height="60"></a></td>
<td width="444">
<p align="center"><img border="0" src="jpg/ico.gif"></td>
</tr>
</table>
</center>
</div>
<%
mypage=request.querystring("whichpage")
if mypage="" then
mypage=1
end if
if mypage=1 then
toppage=1
else
toppage=mypage-1
end if
nextpage=mypage+1
ps=5
mypagesize=request.querystring("pagesize")
if mypagesize="" then
mypagesize=ps
end if
set conn=server.createobject("adodb.connection")
connstr="dbq="+server.mappath("jpg/sj.mdb")+";defaultdir=;driver={microsoft access driver (*.mdb)};"
conn.open connstr
sql="select * from member"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,3
rall=rs.recordcount 'all
rs.pagesize=mypagesize 'page
pageall=cint(rs.pagecount)
if not rs.eof then
rs.absolutepage=mypage 'now page
end if
if not rs.eof then
%>
<form name="mm" method="post" action="master2.asp">
<div align="center">
<center>
<table border="0" width="755" cellpadding="0">
<tr>
<td width="100%" colspan="5" style="border-bottom-style: ridge; border-bottom-width: 1" bgcolor="#FFECF5">
<p align="center">共找到<%=rall%>位会员,分<%=pageall%>页,每页<%=ps%>位,现在是第<%=mypage%>页,<a href="<%=scriptname%>?whichpage=1&pagesize=<%=ps%>">第1页</a>,<a href="<%=scriptname%>?whichpage=<%=toppage%>&pagesize=<%=ps%>">上一页</a>,<a href="<%=scriptname%>?whichpage=<%=nextpage%>&pagesize=<%=ps%>">下一页</a>,
到第
<select size="1" name="d1" onchange="location.href=this.options[this.selectedIndex].value">
<% for j=1 to pageall %>
<option value="<%=scriptname%>?whichpage=<%=j%>&pagesize=<%=mypagesize%>"><%=j%>
</option>
<%
next
%>
</select>
页</td>
</tr>
<tr>
<td width="10%" bgcolor="#FFECF5">
<p align="center"> </td>
<td width="10%" bgcolor="#FFECF5"> </td>
<td width="60%" bgcolor="#FFECF5">
<p align="center"> </td>
<td width="10%" bgcolor="#FFECF5"> </td>
<td width="10%" bgcolor="#FFECF5"> </td>
</tr>
</table>
</center>
</div>
<div align="center">
<center>
<table width="755" border="1" bgcolor="#FFECF5">
<tr>
<td>
<%
p=0
while not rs.eof and p<5
%>
<p align="left" style="margin-left: 5"> <input type="checkbox" name="C1" value="<%=rs("uname")%>">[<%=rs("ID")%>
<%
if rs("aspyn")="开通" then
response.write " ★☆★"
end if
%>]<input type=text size=10 value=<%=rs("uname")%>>
<font color="#FF0000">密码</font>:<input type=text size=10 value=<%=rs("pass")%>>,<font color="#FF0000">姓名</font>:<%=rs("name")%>
,<font color="#FF0000">邮编</font>:<%=rs("post")%>  ,<font color="#0000FF">地址</font>:<%=rs("addr")%> 
,<font color="#0000FF">信箱</font>:<%=rs("email")%>  ,<font color="#0000FF">网名</font>:<%=rs("webname")%> 
,<font color="#0000FF">网址</font>:<a href="<%=rs("weburl")%>" target="_blank"><%=rs("weburl")%></a> 
,<font color="#0000FF">免费空间</font>:<%=rs("aspyn")%> ,<font color="#0000FF">备注-fid</font>:<%=rs("fid")%>  ,<font color="#0000FF"><br>加入时间</font>:<%=rs("times")%> 
,<font color="#0000FF">说明</font>:<%=rs("message")%></p>
<%
rs.movenext
p=p+1
wend
else
response.write"没有记录!"
end if
rs.close
conn.close
set rs=nothing
set conn=nothing
%>
</td>
</tr>
</table>
</center>
</div>
<p align="center"><input type="submit" value="删除用户" name="b">   
<input type="submit" value="开通网站" name="b">
(只选1个)
</form>
</body>

</html>
 
asp分页:
<html>

<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>管理员</title>
<style>
P {
COLOR: #000000; FONT-SIZE: 9pt; LINE-HEIGHT:12pt
}
A:hover {
COLOR: #ff00ff;text-decoration:none
}
A:link {
COLOR: #000000;text-decoration:none
}
A:visited {
COLOR:#000000;text-decoration:none
}
TD {
font-size:9pt
}
</style>

</head>

<body topmargin=1>
<div align="center">
<center>
<table border="0" width="755" cellspacing="0" cellpadding="0" height="60">
<tr>
<td width="307">
<p align="center"><a href="index.asp"><img border="0" src="index.jpg" width="300" height="60"></a></td>
<td width="444">
<p align="center"><img border="0" src="jpg/ico.gif"></td>
</tr>
</table>
</center>
</div>
<%
mypage=request.querystring("whichpage")
if mypage="" then
mypage=1
end if
if mypage=1 then
toppage=1
else
toppage=mypage-1
end if
nextpage=mypage+1
ps=5
mypagesize=request.querystring("pagesize")
if mypagesize="" then
mypagesize=ps
end if
set conn=server.createobject("adodb.connection")
connstr="dbq="+server.mappath("jpg/sj.mdb")+";defaultdir=;driver={microsoft access driver (*.mdb)};"
conn.open connstr
sql="select * from member"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,3
rall=rs.recordcount 'all
rs.pagesize=mypagesize 'page
pageall=cint(rs.pagecount)
if not rs.eof then
rs.absolutepage=mypage 'now page
end if
if not rs.eof then
%>
<form name="mm" method="post" action="master2.asp">
<div align="center">
<center>
<table border="0" width="755" cellpadding="0">
<tr>
<td width="100%" colspan="5" style="border-bottom-style: ridge; border-bottom-width: 1" bgcolor="#FFECF5">
<p align="center">共找到<%=rall%>位会员,分<%=pageall%>页,每页<%=ps%>位,现在是第<%=mypage%>页,<a href="<%=scriptname%>?whichpage=1&pagesize=<%=ps%>">第1页</a>,<a href="<%=scriptname%>?whichpage=<%=toppage%>&pagesize=<%=ps%>">上一页</a>,<a href="<%=scriptname%>?whichpage=<%=nextpage%>&pagesize=<%=ps%>">下一页</a>,
到第
<select size="1" name="d1" onchange="location.href=this.options[this.selectedIndex].value">
<% for j=1 to pageall %>
<option value="<%=scriptname%>?whichpage=<%=j%>&pagesize=<%=mypagesize%>"><%=j%>
</option>
<%
next
%>
</select>
页</td>
</tr>
<tr>
<td width="10%" bgcolor="#FFECF5">
<p align="center"> </td>
<td width="10%" bgcolor="#FFECF5"> </td>
<td width="60%" bgcolor="#FFECF5">
<p align="center"> </td>
<td width="10%" bgcolor="#FFECF5"> </td>
<td width="10%" bgcolor="#FFECF5"> </td>
</tr>
</table>
</center>
</div>
<div align="center">
<center>
<table width="755" border="1" bgcolor="#FFECF5">
<tr>
<td>
<%
p=0
while not rs.eof and p<5
%>
<p align="left" style="margin-left: 5"> <input type="checkbox" name="C1" value="<%=rs("uname")%>">[<%=rs("ID")%>
<%
if rs("aspyn")="开通" then
response.write " ★☆★"
end if
%>]<input type=text size=10 value=<%=rs("uname")%>>
<font color="#FF0000">密码</font>:<input type=text size=10 value=<%=rs("pass")%>>,<font color="#FF0000">姓名</font>:<%=rs("name")%>
,<font color="#FF0000">邮编</font>:<%=rs("post")%>  ,<font color="#0000FF">地址</font>:<%=rs("addr")%> 
,<font color="#0000FF">信箱</font>:<%=rs("email")%>  ,<font color="#0000FF">网名</font>:<%=rs("webname")%> 
,<font color="#0000FF">网址</font>:<a href="<%=rs("weburl")%>" target="_blank"><%=rs("weburl")%></a> 
,<font color="#0000FF">免费空间</font>:<%=rs("aspyn")%> ,<font color="#0000FF">备注-fid</font>:<%=rs("fid")%>  ,<font color="#0000FF"><br>加入时间</font>:<%=rs("times")%> 
,<font color="#0000FF">说明</font>:<%=rs("message")%></p>
<%
rs.movenext
p=p+1
wend
else
response.write"没有记录!"
end if
rs.close
conn.close
set rs=nothing
set conn=nothing
%>
</td>
</tr>
</table>
</center>
</div>
<p align="center"><input type="submit" value="删除用户" name="b">   
<input type="submit" value="开通网站" name="b">
(只选1个)
</form>
</body>

</html>
 
后退
顶部