⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 asp_syntax.asp@output=print

📁 W3Schools tutorial..web designing
💻 ASP@OUTPUT=PRINT
字号:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en-US" xml:lang="en-US" xmlns="http://www.w3.org/1999/xhtml">
<head>

<title>ASP Syntax</title>
 
<link rel="shortcut icon" href="../favicon.ico" type="image/x-icon" />
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<meta name="Keywords" content="xml,tutorial,html,dhtml,css,xsl,xhtml,javascript,asp,ado,vbscript,dom,sql,colors,soap,php,authoring,programming,training,learning,beginner's guide,primer,lessons,school,howto,reference,examples,samples,source code,tags,demos,tips,links,FAQ,tag list,forms,frames,color table,w3c,cascading style sheets,active server pages,dynamic html,internet,database,development,Web building,Webmaster,html guide" />

<meta name="Description" content="Free HTML XHTML CSS JavaScript DHTML XML DOM XSL XSLT RSS AJAX ASP ADO PHP SQL tutorials, references, examples for web building." />

<meta http-equiv="pragma" content="no-cache" />
<meta http-equiv="cache-control" content="no-cache" />

<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "../../https@ssl./default.htm" : "../../www./default.htm");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
var pageTracker = _gat._getTracker("UA-3855518-1");
pageTracker._initData();
pageTracker._trackPageview();
</script>

</head>

<body>

<p>From <b>http://www.w3schools.com</b> (Copyright Refsnes Data)</p>

<h1>ASP Syntax</h1>
<a href="asp_install.asp"><img alt="previous" border="0" src="../images/btn_previous.gif" width="100" height="20" /></a>
<a href="asp_variables.asp"><img alt="next" border="0" src="../images/btn_next.gif" width="100" height="20" /></a>
<hr />

<p class="intro">You cannot view the ASP source code by selecting &quot;View source&quot; in a browser, you will
only see the output from the ASP file, which is plain HTML. This is because the scripts
are executed on the server before the result is sent back to the browser.</p>
<p class="intro">In our ASP tutorial, every example displays the
hidden ASP source code. This will make it easier for you to understand how it works.</p>
<hr />

<h2>Examples </h2>
<p>
<a target="_blank" href="showasp.asp@filename=demo_text">Write text with ASP</a><br />
How to write some text with ASP.
</p>
<p>
<a target="_blank" href="showasp.asp@filename=demo_formatting">Add some HTML to the text</a><br />
How to format the text with HTML tags.
</p>
<hr />

<h2>The Basic Syntax Rule </h2>
<p>An ASP file normally contains HTML tags, just like an HTML file. However, an ASP file
can also contain <b> server scripts</b>, surrounded by the delimiters <b> &lt;%</b>
and <b> %&gt;</b>. Server scripts are <b> executed on the server, </b>and can
contain any expressions, statements, procedures, or operators valid for the scripting language you 
prefer to use. </p>
<hr />

<h2>Write Output to a Browser</h2>
<p>The response.write command is used to write output to a browser. The 
following example sends the text
&quot;Hello World&quot; to the browser:</p>
<table width="100%" border="1" class="ex" cellspacing="0"><tr><td>
<pre>&lt;html&gt;
&lt;body&gt;
<span class="red">&lt;%
response.write(&quot;Hello World!&quot;)
%&gt;</span>
&lt;/body&gt;
&lt;/html&gt;</pre>
</td></tr></table>
<p>There is also a shorthand method for the response.write command. The following 
example also sends the text
&quot;Hello World&quot; to the browser:</p>
<table width="100%" border="1" class="ex" cellspacing="0" id="table1"><tr><td>
<pre>&lt;html&gt;
&lt;body&gt;
<span class="red">&lt;%=&quot;Hello World!&quot;%&gt;</span>
&lt;/body&gt;
&lt;/html&gt;</pre>
</td></tr></table>
<br />
<hr />

<h2>VBScript</h2>
<p>You can use several scripting languages in ASP. However, the default 
scripting language is VBScript:</p>
<table width="100%" border="1" class="ex" cellspacing="0"><tr><td>
<pre>&lt;html&gt;
&lt;body&gt;
<span class="red">&lt;%
response.write(&quot;Hello World!&quot;)
%&gt;</span>
&lt;/body&gt;
&lt;/html&gt;</pre>
</td></tr></table>
<p>The example above writes &quot;Hello World!&quot; into the body of the document. </p>
<hr />

<h2>JavaScript </h2>
<p>To set JavaScript as the default scripting language
for a particular page you must insert a
language specification at the top of the page:</p>
<table width="100%" border="1" class="ex" cellspacing="0"><tr><td>
<pre>&lt;%@ language=&quot;javascript&quot;%&gt;
&lt;html&gt;
&lt;body&gt;
<span class="red">&lt;%
Response.Write(&quot;Hello World!&quot;)
%&gt;</span>
&lt;/body&gt;
&lt;/html&gt;</pre>
</td></tr></table>
<p><b>Note:</b> Unlike VBScript - JavaScript is case sensitive. You will have to write your ASP
code with uppercase letters and lowercase letters when the language requires it. </p>
<hr />

<h2>Other Scripting Languages </h2>
<p>ASP is shipped with VBScript and JScript (Microsoft's implementation of JavaScript). If you want to script in another
language, like PERL, REXX, or Python, you will have to install script engines
for them.</p>

<p> <b>Important:</b> Because the scripts are executed on the server,
the browser that displays the ASP file does not need to support scripting at 
all!</p>

<hr />
<a href="asp_install.asp"><img alt="previous" border="0" src="../images/btn_previous.gif" width="100" height="20" /></a>
<a href="asp_variables.asp"><img alt="next" border="0" src="../images/btn_next.gif" width="100" height="20" /></a>

<p>From <b>http://www.w3schools.com</b> (Copyright Refsnes Data)</p>

</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -