Tips for using double quotation marks and & connectors in ASP

Source: Internet
Author: User
Tags continue variables
Skill

One, ASP in double quotation marks can be any character, string, HTML code

1.<%response.write ("I am here")%><%response.write ("Cnbruce here")%>

2.<%response.write ("<b>i am here</b>")%>

3.< double quotes for the nearest match, such as single quotes and connectors included in and connected to < deferred quotes >>response.write ("I am Here ")

Because the front quotes of color and the front quotes of write match, the content is I amhere. The end result: The #0000ff in the middle is lonely.

<%response.write ("<font color=" & "#0000ff" & ">i am Here</font>")%>
<%

Response.Write ("cnbruce")

%>

Second, single quotes: As in learning Chinese class, the quotation marks that continue to be placed in double quotes can be in single quotes

Response.Write ("I amhere")

The main function of & number in ASP is to connect, including: string-string, string-variable, variable-variable, etc mixed connection

<%
mycolor="#0000ff"
Response.Write ("<font color= " &mycolor&" >" & " Cnbruce" & "</font>)
%>
<%

Mycolor= "#0000ff"

Response.Write ("" & "Cnbruce" &"")

%>

Single quotes (not in double quotes) < variable keep > key writing:< the variables in the ASP continue to be added around the "& include", which can be put into Response.Write quotes, and the effect is: Response.Write ("" &mycolor& "")

Note:asp< output response main processing variables, strings, HTML code > (a single tag can be treated as a string)

Response.Write "a"

Response.Write ("a")

Display is the output of the < string a,>

and Response.Write (a) and <%=a%><%=a%> output is the value of variable a







Related Article

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.