19 Basic Tips for ASP

Source: Internet
Author: User
1. The present date Time command is
<%=now%> can
The 2.ASP method for obtaining data entry from a form is to use a built-in object (-requect).
It varies with get,post.
3. If you want to write your own VB or other language, the. dll file should be registered with the DLL for ASP: DOS
Enter Regsbr32 *.dll
4. Show five repeating sentences, fonts getting bigger
<% for I=1 to 5%>
<font size=<% =i%> color= #00ffff >
Fast ASP
</font>
<br>
<% Next%>
5. Send string to Client
Response.Write string
such as: <% Response.Write "Welcome"%>
6. Link to the specified URL address
Response.Redirect URL
Such as:
<% Response.Redirect "Homepage.asp"
%>
* But if this. The ASP's file content has been routed to the user, and then an error occurs when the redirect is used.
7. Integration of other languages with ASP:
Such as: Morning display, good afternoon show you
<%
If time>+ #12:00:00 am# and time< #12:00:00 PM #
Then
Greeting= "Good morning!"
Else
greeting= "Hello!"
End If
%>
<%=greeting%>
The application of 8.<script> tag in ASP
Cases:
<body>
<% Call Function1%>
</body>
<script Runat=server language=javascript>
function Function1 ()
{
...
}
</script>
9. #include including other documents
<!--#include virtual|file= "filename"-->
Virtual refers to a fictitious file address.
File represents an absolute filename address.
Such as:
<!--#include virtual= "/booksamp/test.asp"-->
<!--#include file= "/test/test.asp"-->
And you can nest layers. In addition, #include cannot be within <%--%>
10.ASP method to get form input data
: Get POST
A. Get: The client adds the data to the URL after the format is "? Field 1 = input data 1& field 2 = input data 2&amp ... ",
And then send it to the server.
For example: actiowww.abc.com, field name input data is Jack, field age data is 15, then use the Get method to
Http://www.abc.com?Name=jack&Age=15
Two. Post: The client uses HTTP information data to transfer to the server
In asp:

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.