A good paging method, data deletion method (with confirmation and cancellation windows), search for keyword (including spaces) processing-ASP tutorial, data
Source: Internet
Author: User
<! -- # Include file = "connect. asp" -->
<%
Keyword = request ("Keyword ")
Keyword = replace (Keyword ,"","")
Page = Request. QueryString ("page ")
SQL = "select * from exam information where exam name like '%" & keyword & "% '"
Rs. open SQL, conn, 1, 1
Dim page, maxPerPage
MaxPerPage = 2' number of records displayed per page
Rs. pagesize = MaxPerPage
If (page = "" or isempty (page) then page = 1
ThisUrl = "2.asp? Keyword = "& Keyword
Session ("adminOldUrl") = thisUrl & "& page =" & page
%>
<Script language = "JavaScript">
<! --
Function MM_reloadPage (init) {// reloads the window if Nav4 resized
If (init = true) with (navigator) {if (appName = "Netscape") & (parseInt (appVersion) = 4 )){
Document. MM_pgW = innerWidth; document. MM_pgH = innerHeight; onresize = MM_reloadPage ;}}
Else if (innerWidth! = Document. MM_pgW | innerHeight! = Document. MM_pgH) location. reload ();
}
MM_reloadPage (true );
Function jumpTo (I ){
If (I = 1 ){
This.doc ument. location = "<% = thisUrl %> ";}
If (I = 2 ){
This.doc ument. location = "<% = thisUrl %> & page = <% = page-1%> ";}
If (I = 3 ){
This.doc ument. location = "<% = thisUrl %> & page = <% = page + 1%> ";}
If (I = 4 ){
This.doc ument. location = "<% = thisUrl %> & page = <% = rs. pageCount %> ";}
}
// -->
</Script>
<Form method = "post" action = "2.asp">
<Input type = "text" name = "keyword" size = 57 value = "" maxlength = "50" style = "width: 390; height: 20"> & nbsp; & nbsp;
<Input type = "submit" name = "Sub" value = ""> </td> </form>
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service