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

感情迁移 提交于 2019-12-07 19:43:04

问题


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".


回答1:


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.




回答2:


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.




回答3:


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)




回答4:


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

No idea if this is correct or not.




回答5:


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.



来源:https://stackoverflow.com/questions/314397/in-asp-net-what-is-the-asp-code-called

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!