In the previous section, we briefly introduced the preparation environment of ASP +. In this section, we will talk about the syntax of ASP +. in fact, after you install NGWS, the documents it carries are the best course of learning ASP +. It is not difficult to learn ASP + because E is good enough and patient. these guys have learned a lot from here. Most of this article on ASP + syntax also comes from the original text of M $. Unfortunately, our server cannot be installed with NGWS, in some examples, the execution results are not very good. However, in some cases, I will display the execution results. Let's start this section :)
The suffix of an ASP + page is ". ASPX ". it can contain eight different syntax tagging elements. we will introduce these different syntaxes in this article and give an example to demonstrate their usage.
<%> And <% = %>
Have you used asp or asp. The following is a simple example. I don't think I can write the result after his execution, and everyone knows it. I will not talk about this much.
<% For (int I = 0; I <8; I ++)
{
%>
Hello World!
<% }%>
In the preceding example, the program between <%> is executed and the result is displayed. <% = "Hello World" %> is equal to <% Response. write ("Hello World") %>
Note: in C #, semicolon (;) is used as the separator, but we should pay attention to some things.
C # code
<% Response. Write ("Hello World"); %>
The semicolon here is required
<% = "Hello World"; %>
In this case, there will be some minor issues: the displayed result is "Response. Write (" Hello World ";);"
Correct