WEB DEVELOPER SITE
HTMLCSSJAVASCRIPTSQLPHPBOOTSTRAPJQUERYANGULARXML
 

ASP Basic Syntax Rules


In our ASP instructional exercise, each precedent demonstrates the concealed ASP source code. This will make it less demanding for you to see how it works.


Write Output to a Browser

An ASP record typically contains HTML labels, much the same as a HTML document. Be that as it may, an ASP record can likewise contain server contents, encompassed by the delimiters <% and %>.

Server contents are executed on the server, and can contain any articulations, explanations, techniques, or administrators legitimate for the scripting language you want to utilize.

The response.write Command

The response.write order is utilized to compose yield to a program. The accompanying precedent sends the content "Hello ASP" to the browser:

Example

<!DOCTYPE html>
<html>
<body>
<%
response.write("Hello ASP!")
%>

</body>
</html>

There is additionally a shorthand strategy for the response.write direction. The accompanying precedent additionally sends the content "Hello ASP" to the browser:

Example

<!DOCTYPE html>
<html>
<body>
<%
="Hello ASP!"
%>

</body>
</html>

Using VBScript in ASP

You can utilize a few scripting dialects in ASP. Be that as it may, the default scripting language is VBScript:

<!DOCTYPE html>
<html>
<body>
<%
response.write("Hello ASP!")
%>
</body>
</html>

The precedent above composes "Hello ASP!" into the body of the record.


Using JavaScript in ASP

To set JavaScript as the default scripting language for a specific page you should embed a language particular at the highest point of the page:

<%@ language="javascript"%>
<!DOCTYPE html>
<html>
<body>
<%
Response.Write("Hello ASP!")
%>
</body>
</html>

Note: JavaScript is case touchy! You should compose your ASP code with capitalized letters and lowercase letters when the language requires it.


Other Scripting Languages

ASP is transported with VBScript and JScript (Microsoft's usage of JavaScript). On the off chance that you need to content in another language, as PERL, REXX, or Python, you should introduce content motors for them.