Program code
' function: Definition converted to JavaScript string output (in convention JavaScript, quoted strings in single quotes)' Source: http://www.cncms.com/asp.asp
Function Str4js (sstring)STR4JS = sstringIf IsNull (sstring) Then str4js = "
The ASP functions and ASP procedures provide a way to create reprogramming code available modules and avoid rewriting code each time you perform a specific task in the same block. If you do not have any functions/ASP pages in the program, ASP page
This article introduces asp.net to get the screenshot of the site's example code, the need for friends can refer to the
copy code code as follows:
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data;
Reduce server burden, ASP Prevent Web page refresh code
Sub preventrefresh ()
dim ref reshtime,isrefresh
RefreshTime = 10 ' Prevent refresh time, in seconds
isRefresh = 1 ' use anti-
NextRecordset and GetRows are two attributes of the recordset to improve the speed of the batch query is very effective, you may use very little, share the use of these two methods:
GetRows Method: The recordset Recordset is extracted into a
The ASP Application object is used to share information between all users of a specific aspapplication program. All ASP files are part of a virtual directory in IIS, the same aspapplication program.
The Application.Contents collection contains all
Let's take a look at the example tutorial below.
First take a look at the submitted page:
Here's a look at the page that receives the data and saves it.
Set fs = CreateObject ("Scripting.FileSystemObject")Folderpath=server.mappath ("") &
Global.asa is a text file found in your home directory (/Global.asa). Lou shows the basic extructure a Global.asa file.
Global.asa
The file will be activated in this case:
When the first visitor visits our web pageWhen the new session starts.In
Class cls_fun private x,y,ii ============================== function name: Alertinfo use: Error display function parameter number: Error hint content infostr, turn page Gourl ============= ================= public Function
Class cls_db private connstr private dbpath,dblink,dbi ============================ = = Function name: Db_conn for use: Database connection function parameter number: ======== ====================== private Sub db_conn ()
Use the following methods:
Program codeDim Arr:set arr=new ArrayListArr.add "a": Arr.add "B": Arr.add "C"Response.Write Arr.count & ""For I=0 to Arr.count-1Response.Write Arr.item (i) & ""NextSet arr=nothing%>
Class ArrayList Private M_array ()
Session ("aname") = ""Session ("Admin_flag") = ""Session. Abandon ()Response. Redirect ("Login.asp")%>Session.timeout=60If IsEmpty (Session ("Aname")) or Len (Sessions ("Aname")) =0 or IsEmpty (session ("Admin_flag")) or Len ("Admin_flag" ) =1 or
Function Isinteger (para) on Error Resume Next Dim str Dim l,i If ISNULL (para) then isinteger=false Exit Function End If STR=CSTR (para) if trim (str) = "Then
In For Each ... Next loop like, for ... Next loop. Rather than the specified number of repeated statements,
Every name ... Next loops a repeating collection of objects (or each item) for each element in the array.
The following code fragment
This article mainly introduces how to achieve the asp.net background window, the need for friends can refer to the nextGeneral Bullet window code is as follows: Page.ClientScript.RegisterStartupScript (this. GetType (), "message", "alert (' OK
When we write ASP database programs, we usually use SQL statements, and when we add data and update the data, we usually use the way: INSERT into message (Incept,sender,title,content,sendtime, Flag,issend) VALUES (' "&incept (i) &", ' &membername& "'
ASP tutorial Simple Online user statistics codeThis code is using the ASP apliction and session instance of OH.Sub Application_OnStartApplication. Lock ()Application ("Use_online") =0Application. UnLock ()End SubSub Application_OnEndApplication.
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