急,在线!为什么会有这样的情况
急,在线!为什么会有这样的情况
楼主ireneki(阿雨)2003-08-05 22:48:00 在 Web 开发 / ASP 提问 我做的查询页面,结果显示页面我用了自动刷新:如下
<META HTTP-EQUIV="Refresh" Content="5">
问题出现了,自动刷新后,页面数据就都没了,这是怎么了。
而且分页功能也是一样,如果有的话,点击就什么都没了。这是怎么回事。请高手指点。立即结贴! 问题点数:100、回复次数:10Top
1 楼ronanlin(旭)回复于 2003-08-05 22:55:26 得分 0
<META HTTP-EQUIV=REFRESH CONTENT="1;URL=AddProduct.asp">
后面加上跳转的页面。。
看看行不行。Top
2 楼ceocio(成都招聘.Net工程师,有意者请联系我)回复于 2003-08-05 22:57:08 得分 10
你的查询条件必须传递到下一个URL才行,比如你的查询是keyword=<%=reques("keyword")%>
那么你的应该包括aaa.asp?page=2&keyword=<%=reques("keyword")%>Top
3 楼shangdidewusheng(野马)回复于 2003-08-05 23:05:07 得分 0
把查询条件存在session里面,无论怎么刷新都没关系,不过这并不是一个好的办法Top
4 楼ireneki(阿雨)回复于 2003-08-05 23:16:58 得分 0
不行啊。怎么我用dw4自动生成的查询页面刷新没问题。自己手写代码就不行了呢。楼上的,怎么用session啊。我是菜鸟,帮帮忙。谢谢Top
5 楼ahuiok(希羽)回复于 2003-08-06 00:17:41 得分 50
可以试试手动刷新么。
<a href="javascript:location.reload();">刷新本页</a>
至于向下翻页的问题,一定是除了向下翻页的页码参数还有别的参数要传,
<a href="next.asp?Page=<%= Page+1%>&id=<%=request("id")%>"></a>Top
6 楼feiyun2001(菩提本无树,明镜也非台)回复于 2003-08-06 00:27:56 得分 20
为什么是用自动刷新呢》
正如楼上所说
你查询的时候一定是带参数的。而你刷新的时候就没了参数!·(就是表单提交的时间在地址栏中所产生的如http://abc.com/search.asp?par=XXX par=XXX这一段就是表单提交时所产生的!)
你可以把表单的提交方式设为post,但同时是要把search.asp中接收数据的代码要改·
改成request("par")
Top
7 楼dgm8(dgm8)回复于 2003-08-06 00:34:21 得分 20
查询参数要带着走.
<a href="next.asp?Page=<%= Page+1%>&canshu=<%=canshu%>></a>Top
8 楼ireneki(阿雨)回复于 2003-08-06 00:53:58 得分 0
Microsoft OLE DB Provider for ODBC Drivers 错误 "80040e07"
从字符串转换为 datetime 时发生语法错误。
/rz.asp,行16
这个错误怎么改啊。我不想把数据库字段改字符型。
<%
Dim temp,rd
temp = Request.form("mycity")
rd = Request.form("mytime")
%>
<%
set bz = Server.CreateObject("ADODB.Recordset")
bz.ActiveConnection = MM_bus_STRING
bz.Source = "SELECT * FROM dbo.SZ WHERE (DATEDIFF(day, RunDate, "&rd&") = 0) AND (MidStops=""&temp&"" OR Direction=""&temp&"")"
bz.CursorType = 0
bz.CursorLocation = 2
bz.LockType = 3
bz.Open()
bz_numRows = 0
%>
以上是我的部分代码。
那个RunDate出问题,到底怎么解决。Top
9 楼ireneki(阿雨)回复于 2003-08-06 00:59:38 得分 0
结贴了,但是谁好心又是高手就回答一下我最后的问题就是楼上的Top
10 楼ireneki(阿雨)回复于 2003-08-06 03:48:19 得分 0
<%
" *** Recordset Stats, Move To Record, and Go To Record: declare stats variables
" set the record count
bz_total = bz.RecordCount
" set the number of rows displayed on this page
If (bz_numRows < 0) Then
bz_numRows = bz_total
Elseif (bz_numRows = 0) Then
bz_numRows = 1
End If
" set the first and last displayed record
bz_first = 1
bz_last = bz_first + bz_numRows - 1
" if we have the correct record count, check the other stats
If (bz_total <> -1) Then
If (bz_first > bz_total) Then bz_first = bz_total
If (bz_last > bz_total) Then bz_last = bz_total
If (bz_numRows > bz_total) Then bz_numRows = bz_total
End If
%>
<%
" *** Move To Record and Go To Record: declare variables
Set MM_rs = bz
MM_rsCount = bz_total
MM_size = bz_numRows
MM_uniqueCol = ""
MM_paramName = ""
MM_offset = 0
MM_atTotal = false
MM_paramIsDefined = false
If (MM_paramName <> "") Then
MM_paramIsDefined = (Request.QueryString(MM_paramName) <> "")
End If
%>
<%
" *** Move To Record: handle "index" or "offset" parameter
if (Not MM_paramIsDefined And MM_rsCount <> 0) then
" use index parameter if defined, otherwise use offset parameter
r = Request.QueryString("index")
If r = "" Then r = Request.QueryString("offset")
If r <> "" Then MM_offset = Int(r)
" if we have a record count, check if we are past the end of the recordset
If (MM_rsCount <> -1) Then
If (MM_offset >= MM_rsCount Or MM_offset = -1) Then " past end or move last
If ((MM_rsCount Mod MM_size) > 0) Then " last page not a full repeat region
MM_offset = MM_rsCount - (MM_rsCount Mod MM_size)
Else
MM_offset = MM_rsCount - MM_size
End If
End If
End If
" move the cursor to the selected record
i = 0
While ((Not MM_rs.EOF) And (i < MM_offset Or MM_offset = -1))
MM_rs.MoveNext
i = i + 1
Wend
If (MM_rs.EOF) Then MM_offset = i " set MM_offset to the last possible record
End If
%>
<%
" *** Move To Record: if we dont know the record count, check the display range
If (MM_rsCount = -1) Then
" walk to the end of the display range for this page
i = MM_offset
While (Not MM_rs.EOF And (MM_size < 0 Or i < MM_offset + MM_size))
MM_rs.MoveNext
i = i + 1
Wend
" if we walked off the end of the recordset, set MM_rsCount and MM_size
If (MM_rs.EOF) Then
MM_rsCount = i
If (MM_size < 0 Or MM_size > MM_rsCount) Then MM_size = MM_rsCount
End If
" if we walked off the end, set the offset based on page size
If (MM_rs.EOF And Not MM_paramIsDefined) Then
If (MM_offset > MM_rsCount - MM_size Or MM_offset = -1) Then
If ((MM_rsCount Mod MM_size) > 0) Then
MM_offset = MM_rsCount - (MM_rsCount Mod MM_size)
Else
MM_offset = MM_rsCount - MM_size
End If
End If
End If
" reset the cursor to the beginning
If (MM_rs.CursorType > 0) Then
MM_rs.MoveFirst
Else
MM_rs.Requery
End If
" move the cursor to the selected record
i = 0
While (Not MM_rs.EOF And i < MM_offset)
MM_rs.MoveNext
i = i + 1
Wend
End If
%>
<%
" *** Move To Record: update recordset stats
" set the first and last displayed record
bz_first = MM_offset + 1
bz_last = MM_offset + MM_size
If (MM_rsCount <> -1) Then
If (bz_first > MM_rsCount) Then bz_first = MM_rsCount
If (bz_last > MM_rsCount) Then bz_last = MM_rsCount
End If
" set the boolean used by hide region to check if we are on the last record
MM_atTotal = (MM_rsCount <> -1 And MM_offset + MM_size >= MM_rsCount)
%>
<%
" *** Go To Record and Move To Record: create strings for maintaining URL and Form
parameters
" create the list of parameters which should not be maintained
MM_removeList = "&index="
If (MM_paramName <> "") Then MM_removeList = MM_removeList & "&" & MM_paramName & "="
MM_keepURL="":MM_keepForm="":MM_keepBoth="":MM_keepNone=""
" add the URL parameters to the MM_keepURL string
For Each Item In Request.form
NextItem = "&" & Item & "="
If (InStr(1,MM_removeList,NextItem,1) = 0) Then
MM_keepURL = MM_keepURL & NextItem & Server.URLencode(Request.form(Item))
End If
Next
" add the Form variables to the MM_keepForm string
For Each Item In Request.Form
NextItem = "&" & Item & "="
If (InStr(1,MM_removeList,NextItem,1) = 0) Then
MM_keepForm = MM_keepForm & NextItem & Server.URLencode(Request.Form(Item))
End If
Next
" create the Form + URL string and remove the intial "&" from each of the strings
MM_keepBoth = MM_keepURL & MM_keepForm
if (MM_keepBoth <> "") Then MM_keepBoth = Right(MM_keepBoth, Len(MM_keepBoth) - 1)
if (MM_keepURL <> "") Then MM_keepURL = Right(MM_keepURL, Len(MM_keepURL) - 1)
if (MM_keepForm <> "") Then MM_keepForm = Right(MM_keepForm, Len(MM_keepForm) - 1)
" a utility function used for adding additional parameters to these strings
Function MM_joinChar(firstItem)
If (firstItem <> "") Then
MM_joinChar = "&"
Else
MM_joinChar = ""
End If
End Function
%>
<%
" *** Move To Record: set the strings for the first, last, next, and previous links
MM_keepMove = MM_keepBoth
MM_moveParam = "index"
" if the page has a repeated region, remove "offset" from the maintained parameters
If (MM_size > 0) Then
MM_moveParam = "offset"
If (MM_keepMove <> "") Then
params = Split(MM_keepMove, "&")
MM_keepMove = ""
For i = 0 To UBound(params)
nextItem = Left(params(i), InStr(params(i),"=") - 1)
If (StrComp(nextItem,MM_moveParam,1) <> 0) Then
MM_keepMove = MM_keepMove & "&" & params(i)
End If
Next
If (MM_keepMove <> "") Then
MM_keepMove = Right(MM_keepMove, Len(MM_keepMove) - 1)
End If
End If
End If
" set the strings for the move to links
If (MM_keepMove <> "") Then MM_keepMove = MM_keepMove & "&"
urlStr = Request.ServerVariables("URL") & "?" & MM_keepMove & MM_moveParam & "="
MM_moveFirst = urlStr & "0"
MM_moveLast = urlStr & "-1"
MM_moveNext = urlStr & Cstr(MM_offset + MM_size)
prev = MM_offset - MM_size
If (prev < 0) Then prev = 0
MM_movePrev = urlStr & Cstr(prev)
%>
<% If MM_offset <> 0 Then %>
<A HREF="<%=MM_movePrev%></A>
<% End If " end MM_offset <> 0 %>
<% If Not MM_atTotal Then %>
<A HREF="<%=MM_moveNext%>"></A>
<% End If " end Not MM_atTotal %>
为什么,,没用了Top
-
相关文章
2秒记住本站域名
玩过泡泡龙吗?Readygo?Go! 再加上.Com.Cn的后缀,那就是大名小顶的readygo.com.cn
