Recommended: ASP + FLASH + ACCESS Tutorial ASP part: % added=request(added) del=request(del) action=request.QueryString(action) set conn=server.createObject (adodb.connection) set rs=server.createObject (adodb.recordset) dbpath=server.MapPath (db1.mdb) connstr=Driver={Microsoft Access Driver
The MsgBox function displays a message in the dialog box, waits for the user to click the button, and returns a value to indicate the button that the user clicks. The syntax format is as follows:
MsgBox(prompt[,buttons][,title][,helpfile,context])
prompt: Specify the string displayed in the dialog box
buttons: Specify the number and type of display buttons and the icon style used. The default value is 0 (see the table below for parameters)
title: string displayed in the dialog title bar
helpfile: is a string that identifies a help file that provides context-related help to the dialog box
context: is a numeric value that identifies the context number assigned to a help topic by the author of the help file.
Example:
=====================================================================
<script language=vbscript>
Dim ans
ans=MsgBox (Do you want to visit the Qingfeng Little Lotus Pond?,vbYesNo+vbQuestion, prompt information)
If ans=vbYes Then
Window.Navigate http://www.xxxx.net
Else
Document.Write Welcome to this site!
End If
</script>
=====================================================================
The display effect is as follows:
The InputBox function displays prompts in the dialog box, etc. The user enters text or clicks a button, and returns the content of the text box.
InputBox(prompt[,title][,default][,xpos][,ypos][,helpfile,context])
prompt: Specify the string displayed in the dialog box
title: string displayed in the dialog title bar
default: The default string displayed in the text box
xpos: is a numeric value that specifies the distance between the left edge of the dialog box and the left edge of the screen. If omitted, the dialog box will be centered horizontally.
ypos: is a numerical value that specifies the distance between the upper edge of the dialog box and the upper edge of the screen. If omitted, the dialog box will be displayed at about 1/3 of the vertical direction of the screen.
helpfile: is a string that identifies a help file that provides context-related help to the dialog box
context: is a numeric value that identifies the context number assigned to a help topic by the author of the help file.
Example:
===================================================================
<script language=vbscript>
Dim UserName
UserName=InputBox (Please enter your name:, enter your name, Zhang Wuji)
If UserName= Then
Document.Write You did not enter a name.
Else
Document.Write Welcome, & UserName & Friends.
End If
</script>
===================================================================
The effect is shown in the figure below:
Share: asp gets the current URL code Asp Getting the current URL asp does not directly use functions to obtain the current url like JavaScript. I used to naively believe that asp does not have a method to obtain the current url. But recently I found that it is actually OK. If LCase(Request.ServerVariables(HTTPS)) = off Then strTemp = http:// Else strTemp = https:// End If strTemp = strTemp Req