/    Sign up×
Community /Pin to ProfileBookmark

Can I take the user to next page automatically ?

Hi,
I have an asp page where I show data from database.
By clicking next or previous buttons user can go next or previous page and browse records.
Can I take the user to next page automatically after some time (ex. 5 mints?)

[CODE]

<%@ Language=VBScript %>
<%
intpage= Request (“intpage”)
Action= Request(“Action”)

ID = request(“ID”)
News_title= request(“News_title”)
News_date= request(“News_date”)

‘************************************************
Set cnnP = Server.CreateObject(“ADODB.Connection”)
cnnP.Open “aqar”, “”, “”

Set rs = Server.CreateObject(“ADODB.Recordset”)

sql=”SELECT * from news ”

rs.Open sql,cnnp,3,3
intPageCount = rs.PageCount
‘ ********************* End Submit Query ***************************
‘ ********************* Navigation Query ***************************
Select Case Request(“Action”)
case 1
intpage = 1
rs.AbsolutePage = intpage
case 2
intpage = intpage – 1
if intpage < 1 then intpage = 1
case 3
intpage = intpage+1
if intpage > intPageCount then intpage = IntPageCount
case 4
intpage = intPageCount
if rs.eOF then Response.Write (“the bigin”)
case else
intpage = 1
end select
‘ ******************* End Navigation Query ************************
%>
<html>
<head>
<meta http-equiv=”Content-Language” content=”ar-sa”>
<meta http-equiv=”Content-Type” content=”text/html; charset=windows-1256″>
<title>news page</title>
</head>
<body topmargin=”0″ leftmargin=”0″ rightmargin=”0″ bottommargin=”0″ marginwidth=”0″ marginheight=”0″>

<table border=”0″ id=”table1″ cellspacing=”0″ cellpadding=”0″>
<tr>
<th valign=”top”>
<IMG ID=”Picture5″ HEIGHT=196 WIDTH=294 SRC=”./assets/images/sidebar_t_1.gif” VSPACE=0 HSPACE=0 ALIGN=”TOP” BORDER=0 ALT=””></th>
<th valign=”top”>
<p dir=”ltr”>
<IMG ID=”Banner1″ HEIGHT=185 WIDTH=484 SRC=”images/Welcome_news.jpg” HSPACE=0 ALIGN=”left” BORDER=0 ALT=”Welcome” TITLE=”Welcome” NOF=B_H ></th>
<th valign=”top” > <IMG ID=”Banner1″ SRC=”images/banner_bg.gif” ></th>
</tr>
<tr>
<td style=”border-top-style: solid; border-top-width: 4px; padding: 0″>&nbsp;</td>
<td width=”294″ colspan=”2″ style=”padding: 0″ valign=”top” style=”border-top-style: solid; border-top-width: 4px; padding: 0″>
<% news_titles =”..” %>
<font face=”Arial” color=”#FFFFFF”>
<% do until rs2.eof %>
<% news_titles = news_titles & ” <<– ..” & rs2(“News_title”) & ” .. –>> “%>
<% rs2.movenext
loop
%>
<marquee style=”border:1px dotted #7AE10C; padding:1px; color: #000080; font-family: Tahoma” bgcolor=”#EBEBEB” width=”578″ direction=”right” scrolldelay=”150″ scrollamount=”5″><%=news_titles %></marquee></font>
</td>
</tr>
<tr>
<td colspan=”3″>
<form method=”POST” name=”form” action=”Add.asp”>
<table border=”0″ width=”100%” id=”table3″ style=”border-style:solid; border-width:1px; background-image: url(‘images/navBar_bg.gif’)” cellspacing=”0″ cellpadding=”0″>
<tr>
<th colspan=”6″ bgcolor=”#EBEBEB” background=”images/bg-bn.gif”>
<p align=”center”>
<img border=”0″ src=”images/news_search.jpg” align=”top” width=”178″ height=”32″></th>
</tr>
<tr>
<td align=”center” style=”border:1px dotted #C0C0C0; padding:1px; background-repeat: repeat; background-color:#7AB62A; color:#F2F2F2″>
<font color=”#EBEBEB”><b>ÇáÊÍßã</b></font></td>
<td align=”center” style=”border:1px dotted #C0C0C0; padding:1px; background-repeat: repeat; background-color:#7AB62A; color:#F2F2F2″>
<font color=”#EBEBEB”><b>ÅÙåÇÑ ÇáÎÈÑ</b></font></td>
<td align=”center” style=”border:1px dotted #C0C0C0; padding:1px; background-repeat: repeat; background-color:#7AB62A; color:#F2F2F2″>
<font color=”#EBEBEB”><b>ÊÇÑíÎ ÇáÎÈÑ</b></font></td>
<td align=”center” style=”border:1px dotted #C0C0C0; padding:1px; background-repeat: repeat; background-color:#7AB62A; color:#F2F2F2″>
<font color=”#EBEBEB”><b>ÚäæÇä ÇáÎÈÑ</b></font></td>
<td align=”center” style=”border:1px dotted #C0C0C0; padding:1px; background-repeat: repeat; background-color:#7AB62A; color:#F2F2F2″>
<font color=”#EBEBEB”><b>ÊÑÊíÈ ÙåæÑ ÇáÎÈÑ</b></font></td>
<td align=”center” style=”border:1px dotted #C0C0C0; padding:1px; background-repeat: repeat; background-color:#7AB62A; color:#F2F2F2″>
<font color=”#EBEBEB”><b>ÑÞã ÇáÎÈÑ</b></font></td> </tr>
<%
if rs.RecordCount <> 0 then
rs.AbsolutePage=intpage
end if
for intRecord =1 to rs.PageSize
if rs.CacheSize <>1 then exit for
if intpagecount = 0 then exit for
%>
<%
DIM CC
CC= RS.Bookmark

IF CC MOD 2=0 THEN
BGCOLORIT =”#E9F6D8″
ELSE
BGCOLORIT=”#F4FAEB”
END IF
%>
<tr>
<td align=”center” bgcolor =<%=BGCOLORIT%> style=”border:1px dotted #C0C0C0; padding:1px; background-repeat: repeat; color:#F2F2F2″>
<b><font color=”#000080″ size=”2″><a href=”news_Update.asp?ID=<%=rs(“ID”)%>”>
<img border=”0″ src=”images/reply.gif” width=”18″ height=”13″ align=”texttop” alt=”ÊÍÏíË ÈíÇäÇÊ ÇáÎÈÑ”><span lang=”en-us”>
</span></a><br>
<a href=”news_Delete.asp?ID=<%=rs(“ID”)%>”>
<img border=”0″ src=”images/tshc1.gif” width=”16″ height=”16″ align=”texttop” alt=”ÍÐÝ ÇáÎÈÑ”>
</a>
</font></b>&nbsp;</td>
<td align=”center” bgcolor =<%=BGCOLORIT%> style=”border:1px dotted #C0C0C0; padding:1px; background-repeat: repeat; color:#F2F2F2″><% if rs(“show”)=true then %><img border=”0″ src=”images/check2.gif” width=”12″ height=”12″ alt=”ÇÙåÑ ÇáÎÈÑ”><%else%><img border=”0″ src=”images/icon_082.gif” width=”30″ height=”21″ alt=”ÇÎÝí ÇáÎÈÑ”><%end if%>&nbsp;</td>
<td align=”center” bgcolor =<%=BGCOLORIT%> style=”border:1px dotted #C0C0C0; padding:1px; background-repeat: repeat; color:#F2F2F2″>
<font color=”#000080″ size=”2″><b><span lang=”ar-sa”><%=rs(“News_date”)%></span></b></font>&nbsp;</td>
<td align=”center” bgcolor =<%=BGCOLORIT%> style=”border:1px dotted #C0C0C0; padding:1px; background-repeat: repeat; color:#F2F2F2″>
<font color=”#000080″ size=”2″>
<b><%=rs(“News_title”)%></b>&nbsp;</td>
<td align=”center” bgcolor =<%=BGCOLORIT%> style=”border:1px dotted #C0C0C0; padding:1px; background-repeat: repeat; color:#F2F2F2″>
<font color=”#000080″ size=”2″><b><span lang=”ar-sa”><%=rs(“News_Order”)%></span></b></font>&nbsp;</td>
<td align=”center” bgcolor =<%=BGCOLORIT%> style=”border:1px dotted #C0C0C0; padding:1px; background-repeat: repeat; color:#F2F2F2″>
<font color=”#000080″ size=”2″><b><span lang=”ar-sa”><%=rs(“ID”)%></span></b></font>&nbsp;</td>
</tr>
<% rs.MoveNext
if rs.EOF then exit for
next
%>
<tr>
<td style=”border-bottom-style: solid; border-bottom-width: 4px; background-repeat: repeat; border-left-style:dashed; border-left-width:1px; border-right-style:dashed; border-right-width:1px; border-top-style:dashed; border-top-width:1px” colspan=”2″>
<b><font size=”1″ color=”#737164″ face=”Arial”>
Page: <%
if rs.RecordCount <> 0 then
Response.Write (intpage & “&nbsp;”&”of”&”&nbsp;&nbsp;”&intpagecount)
else
Response.Write (intpagecount & “&nbsp;”&”of”&”&nbsp;&nbsp;”&intpagecount)
end if
%>
</font></b>
&nbsp;</td>
<td style=”border-bottom-style: solid; border-bottom-width: 4px; background-repeat: repeat; border-left-style:dashed; border-left-width:1px; border-right-style:dashed; border-right-width:1px; border-top-style:dashed; border-top-width:1px” colspan=”4″>
<p align=”center”>
<% if intpage > 1 then %>
<a href=”index_search2.asp?action=1&intpage=<%=intpage%>&ID=<%=trim(request(“ID”))%>&Title =<%=trim(request(“Title”))%>&location =<%=trim(request(“location”))%>”>
<img border=”0″ src=”images/FirstOff.gif” WIDTH=”42″ HEIGHT=”14″ align=”texttop”></a>
<a href=”index_search2.asp?action=2&intpage=<%=intpage%>&ID=<%=trim(request(“ID”))%>&Title =<%=trim(request(“Title”))%>&location =<%=trim(request(“location”))%>”>
<img border=”0″ src=”images/PrevOff.gif” WIDTH=”35″ HEIGHT=”14″ align=”texttop”></a> <% end if %>..
<% if intpage < intpagecount then %>
<a href=”index_search2.asp?action=3&intpage=<%=intpage%>&ID=<%=trim(request(“ID”))%>&Title =<%=trim(request(“Title”))%>&location =<%=trim(request(“location”))%>”>
<img border=”0″ src=”images/NextOff.gif” width=”33″ height=”14″ align=”texttop”></a><span lang=”en-us”>
</span><a href=”index_search2.asp?action=4&intpage=<%=intpage%>&id=<%=trim(request(“ID”))%>&Title =<%=trim(request(“Title”))%>&location =<%=trim(request(“location”))%>”><img border=”0″ src=”images/LastOff.gif” WIDTH=”39″ HEIGHT=”14″ align=”texttop”></a> <% end if %>
&nbsp;</td>
</tr>
</table>
<input type=”hidden” name=”ID” value=”<%=ID%>”></form>
</td>
</tr>
<tr>
<td colspan=”3″ style=”border-bottom-style: solid; border-bottom-width: 5px; background-image: url(‘images/navBar_bg.gif’); background-repeat: repeat”>
<p align=”center”>
<img border=”0″ src=”assets/images/sidebar_bg.gif” width=”294″ height=”10″></td>
</tr>
</table>
</body></html>
[/CODE]

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@buntineJul 07.2004 — Yes, you sure can. Though, it will need to be written using a client-side technology, such as JavaScript.

ASP runs from the server, thus disallowing any client-side interaction.

I have moved this thread to the JavaScript forum for you.

Regards,

Andrew Buntine.
Copy linkTweet thisAlerts:
@malbar99authorJul 07.2004 — ? ,Thanks,

Can you help me writting that code ??
×

Success!

Help @malbar99 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...