Sign-up....

ASP中框架分页问题!

ASP中框架分页问题,我做的是两个子框架,一个是HouYun(货运),一个是ShouHou(收货)

由于我将翻页的连接放在主窗体表格中('上一页','下一页'),

发现一个问题,这个'上一页','下一页'刷新不出来,

如果刷新主窗体,则两个子框架中记录信息会丢失,

如果不刷新,就出现上面的'上一页','下一页'刷新不出来,

我组长要我第一次打开主窗体时,不显示记录集,因为速度比较慢!点'显示资料'才显示在子框架中顯示(HouYun或ShouHou),

主窗体代码如下:(session('curpage')变量为HouYun(货运)的,session('curpage1')变量为ShouHou(收货),同样Session(TotalPages)和Session(TotalPages1)也是)

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=big5">

<title>货运管理</title>

<link href="mycss.css" rel="stylesheet" type="text/css">

</head>

<body>

<center><form name='form1' method="post" style="margin:0px" >

<%

'初始化当前页和总页数

if isempty(Session("CurPage")) then Session("CurPage")=1

if isempty(Session("TotalPages")) then Session("TotalPages")=1

if isempty(Session("CurPage1")) then Session("CurPage1")=1

if isempty(Session("TotalPages1")) then Session("TotalPages1")=1

%>

<table width="762" border="0" cellpadding="0" cellspacing="0">

<!--DWLayoutTable-->

<tr>

<td height="150" colspan="4" valign="top"><img src="harbourBW.jpg" width="760" height="150"></td>

</tr>

<tr>

<td width="158" height="1"></td>

<td colspan="3" rowspan="2" valign="top"><a href="shouhouchaxun.asp"><div align="right">   收货部   </div></a></td>

</tr>

<tr>

<td height="17" valign="top"><div align="left"><a href="/NwAppWeb/default.asp">首页</a>><a href="/NwAppWeb/Freightage/index.asp">登录</a>>查询</div></td>

</tr>

<tr>

<td height="12" valign="top"></td>

<td width="400" valign="top"></td>

<td width="6"> </td>

<td width="198" rowspan="3" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">

<!--DWLayoutTable-->

<tr>

<td width="198" height="12" valign="top"><!--DWLayoutEmptyCell--> </td>

</tr>

<tr>

<td height="15" valign="top">今天收货>><a href="<%="shouhou.asp?curpage=" & Cint(Session("CurPage1"))%>" target="shouhou">显示资料</a></td>

</tr>

<tr>

<td height="245" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#000000">

<!--DWLayoutTable-->

<tr>

<th width="129" height="20" align="center" valign="middle">公司名称</th>

<th width="66" valign="middle">部门</th>

</tr>

<tr bgcolor="#FFFFFF">

<td height="200" colspan="2" valign="top"><iframe width="100%" src=" frameborder="0" scrolling="no" name="shouhou"></iframe></td>

</tr>

<tr bgcolor="#FFFFFF">

<td height="20" colspan="2" valign="top"><div align="left"><font color="#000000">

<% '分页'收货'

on error resume next

if Cint(Session("CurPage1")) > 1 then

Response.Write("<a href='shouhou.asp?curpage=" & Cint(Session("CurPage1")) - 1 & "'" target='shouhou'>上一页</a>")

End If

if CInt(Session("CurPage1")) <> CInt(Session("TotalPages1")) then

Response.Write("<a href='shouhou.asp?curpage=" & Cint(Session("CurPage1")) + 1 & "'" target='shouhou'>下一页</a>")

End If

Response.Write("    第 <input type='text' name='curpage1' value='" & Session("CurPage1") & "' size=2 style='border:1px' disabled> 页,共 <input type='text' name='totalpages1' value='" & Session("TotalPages1") & "' size=2 style='border:1px' disabled>页")

%></font></div></td>

</tr>

</table></td>

</tr>

</table></td>

</tr>

<tr>

<td height="15" colspan="2" valign="top">今天准备出车到深圳>><a href="<%="houyun.asp?curpage=" & Cint(Session("CurPage"))%>" target="houyun">显示资料</a></td>

<td> </td>

</tr>

<tr>

<th colspan="2" rowspan="2" valign="top"><table width="558" border="0" cellpadding="0" cellspacing="1" bgcolor="#000000">

<!--DWLayoutTable-->

<tr>

<td width="131" height="20" valign="top" bgcolor="#000000">货运编号</td>

<td width="170" valign="top" bgcolor="#000000">车别</td>

<td width="134" valign="top" bgcolor="#000000">开车时间</td>

<td width="118" valign="top" bgcolor="#000000">预计进口日期</td>

</tr>

<tr bgcolor="#FFFFFF">

<td height="200" colspan="4" valign="top"><iframe width="100%" src=" frameborder="0" scrolling="no" name="houyun"></iframe></td>

</tr>

<tr align="left" bgcolor="#FFFFFF">

<td height="21" colspan="4" valign="top" ><div align="left"><font color="#000000">

<%

'分页'货运'

if Cint(Session("CurPage")) > 1 then

Response.Write("<a href='houyun.asp?curpage=" & Cint(Session("CurPage")) - 1 & "'" target='houyun'>上一页</a>")

End If

if CInt(Session("CurPage")) <> CInt(Session("TotalPages")) then

Response.Write("<a href='houyun.asp?curpage=" & Cint(Session("CurPage")) + 1 & "'" target='houyun'>下一页</a>")

End If

Response.Write("    第 <input type=text name='curpage' value='" & Session("CurPage") & "' size=2 style='border:1px' disabled>页,共 <input type=text name='totalpages' value='" & Session("TotalPages") & "' size=2 style='border:1px' disabled>页")

%></font></div>

</td>

</tr>

</table></th>

<td height="244"> </td>

</tr>

</table>

</form>

</center>

</body>

</html>

[5120 byte] By [msdn] at [2007-8-15 10:02:59]
# 1 Re: ASP中框架分页问题!

头大~不想看~~

slawdan at 2006-6-7 15:54:23 >
# 2 Re: ASP中框架分页问题!

拷到Dreamweaver中就可看出來了!

xtuwz at 2006-6-7 15:56:15 >
# 3 Re: ASP中框架分页问题!

a href='houyun.asp?curpage=" & Cint(Session("CurPage")) + 1 & "'" target='houyun'>下一页</a>

这里有问题,因为你用Session("CurPage")来记录,不刷新必然出不来新的。

所以,你要用js来判断下一页。

superdullwolf at 2006-6-7 16:12:03 >
# 4 Re: ASP中框架分页问题!

要注意Session 上下页面可能覆盖。

如果上下框架都分页,而且数据有关联,最好在前端操作

net_lover at 2006-6-7 16:13:27 >
# 5 Re: ASP中框架分页问题!

这个程序可以这样写:

点按钮,传递的参数里不包含页码,而只有一个command=nextPage这样的翻页命令。

<a href='houyun.asp?command=prePage' target='xxx'>上一页</a>

<a href='houyun.asp?command=nextPage' target='xxx'>下一页</a>

houyun.asp头部分析command如果是向上翻就currentPageIndex--,下翻就currentPageIndex++

superdullwolf at 2006-6-7 16:32:21 >
# 6 Re: ASP中框架分页问题!

命名规则不要用汉语拼音,更不要用错误的汉语拼音。

虽然程序最重要的是思想,

但是不好的命名风格也常给自己带来负面影响,甚至纠纷。

superdullwolf at 2006-6-7 16:35:53 >
# 7 Re: ASP中框架分页问题!

我得把貼子頂起來才行

xtuwz at 2006-6-8 8:38:33 >
# 8 Re: ASP中框架分页问题!

对框架不是很熟悉,帮不上忙,抱歉

jspadmin at 2006-6-8 21:21:40 >

Web

All Classified