简体   繁体   中英

In ASP.NET, What is the 'ASP' code called?

More detail to my question:

HTML and JavaScript are called "client-side code".

C# and VB in the code behind files are termed "server-side code".

So what is inline-asp, and 'runat=server' code blocks called?

<!-- This is called "client-side" -->
<p>Hello World</p>
<script>alert("Hello World");</script>

...

// This is called "server-side"
public void Page_Load(object sender, EventArgs e)
{
    Response.Write("Hello World");
}

...

<%-- What is this called ??? --%>
<asp:Label ID="MyLabel" runat="server" />
<% Response.Write("Hello World"); %>

The best term I can come up with is "Web Forms Code".

To be explicit, Microsoft calls them Embedded Code Blocks.

http://msdn.microsoft.com/en-us/library/ms178135.aspx

They are code blocks embeded into the page lifecycle by being called during the Render phase.

The sections of an ASP page that start with <% and end with %> are code render blocks and <script> elements with runat=server are called code declaration blocks . The code inside them is server code .

The parts that begin with <%@ are directives . The code render blocks that begin with <%= is just short hand for a call to writer.Write() in the Page.Render() method.

In the ASP section of the MSDN site they are referred to as "script commands" , "server side script commands" and "primary script commands" .

Below I have included excerpts from the MSDN site and a reference link.

ASP uses the delimiters <% and %> to enclose script commands . Within the delimiters, you can include any command that is valid for the scripting language you are using.

Commands enclosed by delimiters are called primary script commands , which are processed using the primary scripting language. Any command that you use within script delimiters must be valid for the primary scripting language. By default, the primary scripting language is VBScript, but you can also set a different default language.

( http://msdn.microsoft.com/en-us/library/ms524741.aspx )

I call them "server tags" or "server-side tags".

No idea if this is correct or not.

Code in the aspx file is called "the markup". That includes static html, as well. If you want to narrow it down to code within <% %> tags just say "code blocks".

The <% %> tags themselves and similar are called "Bee Stings". Note that this is just for the different types of <% %> tags, not the code blocks you create with them.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM