Cool General page Display Control (v) Add, delete, modify records, category settings (top)

Source: Internet
Author: User
Tags include modify query table name
Pagination | control | So far, the work we've done just shows the record.
If we were to add, delete, and modify records in this ASP page, the new problem would come.

This is often encountered when we design programs similar to those that allow users to manage their own address books.

Luckily we've made all the preparations in front of the paging control, and now we just need to do the following:
1. Add a checkbox before each line record
2. Add the "Select All Records" check box, delete, add button below the list of records

If you display a list of categories in query control, you also add the Category Settings button.


Of course, we just need to modify the Listrecords () function and the Listrecordscon.inc file


Please see sample5.asp




< a > ASP files that require paging

Sample5.asp


<!--#include file= ". /inc/functions.inc "-->
<%
'//////////////////////////////////////////////////////////
'
' Define table name
'
'//////////////////////////////////////////////////////////

Thetablename= "AddressBook"

'//////////////////////////////////////////////////////////
'
' Query criteria
'
'//////////////////////////////////////////////////////////

Thequeryfield = "FLD" & Thetablename & "_nickname" query field, full name
Thequerytitle = "nickname" Field display title
thequerytable = Table with VW & Thetablename field, full name

Thequeryclass = thetablename & "_class" category table name, remove TBL, VW prefix
Theclassid = C2int (Request ("ClassID")) ' Current category number

' If this is a query pattern, then construct a fuzzy query statement
If request ("mode") = "Query" Then
%><!--#include file= ". /inc/control/query_result.inc "--><%
Else
' Otherwise ignore
Thequerycon = "1>0"
End If

'//////////////////////////////////////////////////////////
'
' Restrictive conditions
'
'//////////////////////////////////////////////////////////

Thelimitcon = "FLD" & Thetablename & "_userid=" & Session ("UserID")

If Theclassid > 0 Then
Thelimitcon = Thelimitcon & "and fld" & Thequeryclass & "Id=" & Theclassid
End If

'//////////////////////////////////////////////////////////
'
' Construct the SQL statement
'
'//////////////////////////////////////////////////////////

Usql = "SELECT * from" & thequerytable & "where" ("& Thequerycon &") and ("& Thelimitcon & " ) "

%>
<!--#include file= ". /inc/control/navigator_init.inc "-->

<title>test</title>
<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 ">
<link rel= "stylesheet" href= ". /default.css "type=" Text/css ">

<!--your HTML code//-->

<table width= "100%" border= "0" cellspacing= "0" cellpadding= "0" >
<tr>
&n



Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.